Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_utils::start_server may not be necessary #131

Open
sr-gi opened this issue Oct 6, 2022 · 2 comments
Open

test_utils::start_server may not be necessary #131

sr-gi opened this issue Oct 6, 2022 · 2 comments
Labels
tests Issues related with test functionality

Comments

@sr-gi
Copy link
Member

sr-gi commented Oct 6, 2022

While doing some tests for #130 I realized that not starting the BitcoindMock::Server seemed not to make a difference when running the tests. From what I recall when designing it, starting the server was necessary to bring up the HTTP interface BitcoindMock uses. However, looks like this may not be necessary (?).

I've run some tests getting rid of start_server and some tests do hang, so a more thorough examination will be needed.

@sr-gi sr-gi added the tests Issues related with test functionality label Oct 6, 2022
@sr-gi
Copy link
Member Author

sr-gi commented Oct 6, 2022

The logical reason why some test hang may be because of Carrier::hang_until_bitcoind_reachable(), however, is hard to reason why this is not the case for other tests.

@ShubhamBhut
Copy link

I tried to research a little on this and all 10 tests of carrier.rs are running fine without start_server. The tests which are hanged are from watcher.rs and responder.rs and they all are async. Reason being watcher and responder objects need to maintain connection to communicate with the server. While in case of those 10 tests, there is no need to maintain connection as the carrier object contains the variables used to check the query.

If this logic is correct, then I think start_server is not required on those 10 test cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Issues related with test functionality
Projects
None yet
Development

No branches or pull requests

2 participants