mirror of
https://github.com/docker/compose.git
synced 2026-10-12 02:13:08 +00:00
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:
committed by
Nicolas De loof
parent
d834777e12
commit
f7744a872f
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user