Make tests that wait for concurrent work wait on the event or a condition with a long deadline (issue 1814)
A test that slept a fixed time and then asserted what a goroutine, process or watcher did failed under the checker's load. Each now waits for its positive evidence (a started baseline, a call counted, a state reached) within 30 s, and the concurrency-limit tests meet at a barrier instead of overlapping by sleep. Claude-Session: https://claude.ai/code/session_01NcbgfJ9Gum47zkFKWRaovL
This commit is contained in:
@@ -126,12 +126,12 @@ func TestTheActingProcessClearsBetweenItsLooks(t *testing.T) {
|
||||
go func() { RunApply(ctx, a); close(done) }()
|
||||
defer func() { cancel(); <-done }()
|
||||
|
||||
if !waitFor(t, 2*time.Second, func() bool { return f.called("systemctl enable --now srv-library.automount") }) {
|
||||
if !waitFor(t, 30*time.Second, func() bool { return f.called("systemctl enable --now srv-library.automount") }) {
|
||||
t.Fatal("the first look did not arm the pair")
|
||||
}
|
||||
// The server is away and someone opened the mount point: the mount failed after the look.
|
||||
f.setUnit("srv-library.mount", map[string]string{"ActiveState": "failed", "Result": "timeout"})
|
||||
if !waitFor(t, 2*time.Second, func() bool { return f.called("systemctl reset-failed srv-library.mount") }) {
|
||||
if !waitFor(t, 30*time.Second, func() bool { return f.called("systemctl reset-failed srv-library.mount") }) {
|
||||
t.Fatal("a mount that failed between looks, its server away, is cleared before the next look")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user