Skip to content

Conversation

@yacovm
Copy link
Contributor

@yacovm yacovm commented Dec 24, 2025

Why this should be merged

Fixes the flake by giving more time. The wait for event internally waits for 2 seconds and the deadline for the context is also 2 seconds which is borderline in times where the machine is overloaded and the context may expire too soon even though it should've succeeded.

How this works

Increases the timeout.

How this was tested

Commented out the other tests and ran the test 1000 times in parallel in a loop. Can be seen here.

Need to be documented in RELEASES.md?

Signed-off-by: Yacov Manevich <[email protected]>
@yacovm yacovm requested a review from a team as a code owner December 24, 2025 17:55
Copilot AI review requested due to automatic review settings December 24, 2025 17:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses a flaky test by increasing the context timeout in TestWaitForEvent from 2 to 5 seconds. The test was experiencing intermittent failures on overloaded machines because the 2-second timeout was too close to the internal 2-second wait period, causing the context to expire prematurely in edge cases.

  • Increased timeout from 2 to 5 seconds to provide sufficient buffer for the internal wait operation
  • Prevents context deadline expiration on slower/overloaded systems

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@yacovm yacovm changed the title 4757 Fix flake in TestWaitForEvent/WaitForEvent_build_block_after_re-org Dec 24, 2025
@JonathanOppenheimer
Copy link
Member

Closes #4757

@JonathanOppenheimer JonathanOppenheimer linked an issue Dec 31, 2025 that may be closed by this pull request
Copy link
Member

@JonathanOppenheimer JonathanOppenheimer left a comment

Choose a reason for hiding this comment

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

Can you change the test timeout in coreth as well?

@github-project-automation github-project-automation bot moved this to In Progress 🏗️ in avalanchego Jan 12, 2026
Signed-off-by: Yacov Manevich <[email protected]>
Copy link
Contributor

@maru-ava maru-ava left a comment

Choose a reason for hiding this comment

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

Super smelly to rely on tight timing instead of state validation, so hopefully this goes away at some point in the not-too-distant future.

@maru-ava maru-ava added this pull request to the merge queue Jan 13, 2026
Merged via the queue into ava-labs:master with commit 7d6c927 Jan 13, 2026
50 checks passed
@github-project-automation github-project-automation bot moved this from In Progress 🏗️ to Done 🎉 in avalanchego Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done 🎉

Development

Successfully merging this pull request may close these issues.

Fix TestWaitForEvent flake

4 participants