Code Monkey home page Code Monkey logo

Comments (4)

opx221 avatar opx221 commented on June 7, 2024 1

The RPC call should resolve as soon as a response is received, or after the default timeout, whichever happens first.

Can you give a specific example of different behavior?

the rpc call itself does resolve, but it creates another unresolved timeout or promise for checking the timeout that makes jest complain

Jest did not exit one second after the test run has completed.

'This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with `--detectOpenHandles` to troubleshoot this issue.

jest test demonstrating this

import { HttpClient } from 'monero-ts';
import { connectToWalletRpc } from 'monero-ts';

//HttpClient.DEFAULT_TIMEOUT = 1000;
// uncomment to make jest test exit properly

test('rpc does not leave open handles', async () => {
  const walletRpc = await connectToWalletRpc('http://localhost:18081');
  expect(await walletRpc.getPrimaryAddress()).toBeTruthy();
});

from monero-ts.

woodser avatar woodser commented on June 7, 2024

The RPC call should resolve as soon as a response is received, or after the default timeout, whichever happens first.

Can you give a specific example of different behavior?

from monero-ts.

woodser avatar woodser commented on June 7, 2024

I haven't been able to recreate the issue in a jest project, but are you able to test this commit? c0651ab

It cancels the timeout promise on successful response.

Otherwise, maybe you have a project I could check out to recreate?

from monero-ts.

woodser avatar woodser commented on June 7, 2024

Fixed with the last release: 96daaa0

from monero-ts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.