mirror of
https://github.com/docker/compose.git
synced 2026-11-17 13:45:39 +00:00
test(up): report the hook write error from the test goroutine
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
e4640feba3
commit
2a7b5db6fe
1 changed files with 5 additions and 3 deletions
|
|
@ -732,10 +732,11 @@ func TestUpInteractiveShowsTheHookLogsInTheSession(t *testing.T) {
|
|||
serverConn.Close() //nolint:errcheck
|
||||
clientConn.Close() //nolint:errcheck
|
||||
})
|
||||
// The write error is handed back to the test goroutine: reporting it from
|
||||
// here could hit a test that has already finished.
|
||||
writeErr := make(chan error, 1)
|
||||
go func() {
|
||||
if err := writeStdcopyFrame(serverConn, 1, "hook says hello\n"); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
writeErr <- writeStdcopyFrame(serverConn, 1, "hook says hello\n")
|
||||
serverConn.Close() //nolint:errcheck
|
||||
}()
|
||||
h.api.EXPECT().ExecCreate(gomock.Any(), "c1", gomock.Any()).Return(client.ExecCreateResult{ID: "exec1"}, nil)
|
||||
|
|
@ -763,6 +764,7 @@ func TestUpInteractiveShowsTheHookLogsInTheSession(t *testing.T) {
|
|||
case <-time.After(10 * time.Second):
|
||||
t.Fatalf("the session did not return; calls so far: %v", h.daemon.recorded())
|
||||
}
|
||||
assert.NilError(t, <-writeErr)
|
||||
|
||||
var logged []string
|
||||
for _, lines := range consumer.logs {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue