test(e2e): TestAttachRestart failure dumps the daemon's own log view

The FinishedAt anchor did not cure the third-run loss on CI (still 2
worlds for 3 exit notices after a full minute, oldstable runner). The
remaining suspects are on both sides of the API: a line the daemon
never captured (copier torn down before a millisecond-lived run's
output) or a line compose still fails to relay. On timeout the test
now dumps `docker logs` for the container — ground truth that
discriminates the two on the next CI occurrence.

Signed-off-by: Nicolas De Loof <[email protected]>
This commit is contained in:
Nicolas De Loof
2026-09-22 14:45:23 +02:00
committed by Nicolas De loof
parent d834777e12
commit f7744a872f
+5 -2
View File
@@ -163,10 +163,13 @@ func TestAttachRestart(t *testing.T) {
// orders one relative to the other, so the last restart's log line can
// still be in flight the instant the 3rd "exited" is observed above —
// wait for it instead of counting it immediately.
// On failure, dump the daemon's own view of the container log: it
// discriminates a line compose failed to relay (present below, absent
// above) from a line the daemon itself never captured.
c.WaitForCondition(t, func() (bool, string) {
debug := res.Combined()
daemonView := icmd.RunCmd(c.NewDockerCmd(t, "logs", "attach-restart-failing-1")).Combined()
return strings.Count(res.Stdout(), "failing-1 | world") == 3,
fmt.Sprintf("'failing-1 | world' not found 3 times in : \n%s\n", debug)
fmt.Sprintf("'failing-1 | world' not found 3 times in : \n%s\ndaemon log view:\n%s\n", res.Combined(), daemonView)
}, 30*time.Second, 1*time.Second)
}