Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions internals/overlord/checkstate/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ func (s *ManagerSuite) TestFailuresBelowThreshold(c *C) {
Name: "chk1",
Override: "replace",
Period: plan.OptionalDuration{Value: 20 * time.Millisecond},
Timeout: plan.OptionalDuration{Value: 100 * time.Millisecond},
Timeout: plan.OptionalDuration{Value: time.Second},
Threshold: threshold,
Exec: &plan.ExecCheck{
Command: fmt.Sprintf(`/bin/sh -c '[ ! -f %[1]s ] || { rm -f %[1]s; exit 1; }'`, testPath),
Expand Down Expand Up @@ -1259,8 +1259,8 @@ func (s *ManagerSuite) TestPrevChangeIDOnThreshold(c *C) {
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,
Comment on lines 1259 to +1263
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.
Exec: &plan.ExecCheck{
Command: fmt.Sprintf(`/bin/sh -c '[ ! -f %s ]'`, testPath),
},
Expand Down
Loading