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

fix(test): resolve a timing issue in fake_peer_set setup #5398

Merged
merged 3 commits into from
Oct 13, 2022

Conversation

arya2
Copy link
Contributor

@arya2 arya2 commented Oct 12, 2022

Motivation

To fix a mempool test that's failing occasionally.

Closes #5384

Solution

  • Wait for AdvertiseBlock earlier (i.e. before potentially adding transactions to the mempool)

Related cleanups:

  • Replace unreachable!(..) with assert!(added_transactions.is_empty(), ..) in the Nil case where the response is being unwrapped with a match statement
  • Update unreachable and assert messages to say MempoolTransactionIds requests should respond Ok(Vec<UnminedTxId> | Nil)

Review

This is low priority.

Reviewer Checklist

  • Will the PR name make sense to users?
    • Does it need extra CHANGELOG info? (new features, breaking changes, large changes)
  • Are the PR labels correct?
  • Does the code do what the ticket and PR says?
  • How do you know it works? Does it have tests?

@arya2 arya2 added C-bug Category: This is a bug P-Low ❄️ I-integration-fail Continuous integration fails, including build and test failures labels Oct 12, 2022
@arya2 arya2 requested a review from teor2345 October 12, 2022 21:19
@arya2 arya2 requested a review from a team as a code owner October 12, 2022 21:19
… adds match arm for Response::Nil to MempoolTransactionIds request
@arya2 arya2 force-pushed the fix-mempool-requests-for-transactions branch from c724e69 to de9ce41 Compare October 12, 2022 21:22
@teor2345
Copy link
Contributor

@arya2 this seems to close ticket #5384, so I added it to the PR description.

Also, I think this CI failure might be a high priority, we've got multiple reports.

Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's give it a shot!

@teor2345
Copy link
Contributor

This fix does not work on macOS:

timeout while waiting for a request
in zebra_test::mock_service::MockService<zebra_network::protocol::internal::request::Request, zebra_network::protocol::internal::response::Response, zebra_test::mock_service::PanicAssertion, alloc::boxed::Box<dyn std::error::Error+core::marker::Send+core::marker::Sync>>

https://github.com/ZcashFoundation/zebra/actions/runs/3238058141/jobs/5305848404#step:14:10158

Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a fix that works on macOS, or we need to turn off this test on macOS.

@arya2
Copy link
Contributor Author

arya2 commented Oct 12, 2022

@teor2345 Thank you for updating the PR description.

We need a fix that works on macOS, or we need to turn off this test on macOS.

Not a MacOS-specific issue, it caused a timeout while waiting for a request for the AdvertiseBlock. I removed the wait for tip change and moved AdvertiseBlock above where the mempool storage is being accessed.

@arya2 arya2 requested a review from teor2345 October 12, 2022 23:07
@codecov
Copy link

codecov bot commented Oct 12, 2022

Codecov Report

Merging #5398 (a53eba8) into main (8e5425f) will decrease coverage by 0.05%.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5398      +/-   ##
==========================================
- Coverage   79.10%   79.05%   -0.06%     
==========================================
  Files         308      308              
  Lines       39752    39752              
==========================================
- Hits        31447    31427      -20     
- Misses       8305     8325      +20     

Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to work now

mergify bot added a commit that referenced this pull request Oct 13, 2022
@mergify mergify bot merged commit 1cfbe64 into main Oct 13, 2022
@mergify mergify bot deleted the fix-mempool-requests-for-transactions branch October 13, 2022 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug I-integration-fail Continuous integration fails, including build and test failures
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fake_peer_set::mempool_requests_for_transactions failed with Nil response
2 participants