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

enhance(test): Add timeout and retry to test to make them more stable #5732

Merged
merged 21 commits into from
Mar 12, 2025

Conversation

jkrvivian
Copy link
Contributor

Description of change

Rust tests fail during nightly tests, because the tests get slower and thus fail to reach the expected values immediately, this PR adds timeout and retries to fix them.

Links to any relevant issues

Close #5620
Close #5584

Type of change

  • Enhancement

Change checklist

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have checked that new and existing unit tests pass locally with my changes

@jkrvivian jkrvivian added the node Issues related to the Core Node team label Mar 3, 2025
@jkrvivian jkrvivian self-assigned this Mar 3, 2025
@jkrvivian jkrvivian requested review from a team as code owners March 3, 2025 14:19
Copy link

vercel bot commented Mar 3, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
apps-backend ⬜️ Ignored (Inspect) Visit Preview Mar 12, 2025 11:43am
apps-ui-kit ⬜️ Ignored (Inspect) Visit Preview Mar 12, 2025 11:43am
rebased-explorer ⬜️ Ignored (Inspect) Visit Preview Mar 12, 2025 11:43am
wallet-dashboard ⬜️ Ignored (Inspect) Visit Preview Mar 12, 2025 11:43am

@jkrvivian jkrvivian force-pushed the node/improve-unit-tests branch from cc48452 to 2674f4d Compare March 4, 2025 06:38
@jkrvivian jkrvivian requested a review from muXxer March 4, 2025 07:11
@jkrvivian jkrvivian force-pushed the node/improve-unit-tests branch 3 times, most recently from 8fe4a21 to 08ec62b Compare March 5, 2025 07:37
@jkrvivian
Copy link
Contributor Author

We're still investigating test_byzantine_peer_handling. It fails frequently on Linux machines, but it always passes on Mac.

@semenov-vladyslav

@jkrvivian
Copy link
Contributor Author

Regarding the fix on test_byzantine_peer_handling, check out: #5620 (comment)

@@ -982,7 +982,7 @@ impl RandomnessEventLoop {
continue; // don't send partial sigs to self
}
let mut client = RandomnessClient::new(peer.clone());
const SEND_PARTIAL_SIGNATURES_TIMEOUT: Duration = Duration::from_secs(10);
const SEND_PARTIAL_SIGNATURES_TIMEOUT: Duration = Duration::from_secs(30);
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the main culprit behind test_byzantine_peer_handling failures. Increasing the timeout seems to help. But it doesn't look like a proper solution.

@github-actions github-actions bot added the ci Issues related to our CI pipeline label Mar 11, 2025
// longer to verify invalid signatures and thus needs larger
// timeouts.
#[cfg(test)]
const SEND_PARTIAL_SIGNATURES_TIMEOUT: Duration = Duration::from_secs(500);
Copy link
Contributor

Choose a reason for hiding this comment

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

jkrvivian and others added 21 commits March 12, 2025 12:33
… timeout fix works"

test_byzantine_peer_handling succeeded on selfhosted-arm64 with 500 sec timeout:
https://github.com/iotaledger/iota/actions/runs/13791724155/job/38573592500#step:9:2993

This reverts commit a4511f2.
@muXxer muXxer force-pushed the node/improve-unit-tests branch from c34311a to c4f4882 Compare March 12, 2025 11:42
@muXxer muXxer merged commit 0bbc4ab into develop Mar 12, 2025
34 checks passed
@muXxer muXxer deleted the node/improve-unit-tests branch March 12, 2025 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Issues related to our CI pipeline core-protocol node Issues related to the Core Node team
Projects
None yet
6 participants