Skip to content

test: attempt to fix flaky TestFailuresBelowThreshold#830

Open
benhoyt wants to merge 1 commit intocanonical:masterfrom
benhoyt:checkstate-test-fix
Open

test: attempt to fix flaky TestFailuresBelowThreshold#830
benhoyt wants to merge 1 commit intocanonical:masterfrom
benhoyt:checkstate-test-fix

Conversation

@benhoyt
Copy link
Copy Markdown
Contributor

@benhoyt benhoyt commented Mar 30, 2026

Note: this doesn't actually fix the TestPrevChangeIDOnThreshold issue.

Partially addresses #826.

Note: this doesn't actually fix the TestPrevChangeIDOnThreshold issue.

Partially addresses canonical#826.
Copy link
Copy Markdown

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 adjusts check timing parameters in checkstate manager tests to reduce CI flakiness related to exec checks and threshold transitions (partially addressing #826).

Changes:

  • Increased exec-check Timeout from 100ms to 1s in TestFailuresBelowThreshold.
  • Increased exec-check Timeout to 1s and changed Threshold from 3 to 10 in TestPrevChangeIDOnThreshold.

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

Comment on lines 1259 to +1263
Name: "chk1",
Override: "replace",
Period: plan.OptionalDuration{Value: 20 * time.Millisecond},
Timeout: plan.OptionalDuration{Value: 100 * time.Millisecond},
Threshold: 3,
Timeout: plan.OptionalDuration{Value: time.Second},
Threshold: 10,
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

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

Raising the threshold from 3 to 10 changes the behavior this test exercises (time-to-threshold) and may mask the underlying race that caused PrevChangeID to be empty. A more deterministic fix is to keep the smaller threshold and adjust the waitCheck predicate for the DOWN transition to also wait until PrevChangeID == performChangeID (or at least PrevChangeID != "") before asserting, so the test waits for the state to be fully updated instead of relying on timing.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants