compat attach: fix write on closed channel

Waiting on an initialized sync.WaitGroup returns immediately.
Hence, move the goroutine to wait and close *after* reading
the logs.

Fixes: #12904
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
Valentin Rothberg
2022-01-18 16:27:33 +01:00
parent 0bbf8fa140
commit 7e30531f20
2 changed files with 4 additions and 4 deletions

View File

@ -130,7 +130,7 @@ class ContainerTestCase(APITestCase):
def test_attach(self):
self.skipTest("FIXME: Test timeouts")
r = requests.post(self.uri(self.resolve_container("/containers/{}/attach")), timeout=5)
r = requests.post(self.uri(self.resolve_container("/containers/{}/attach?logs=true")), timeout=5)
self.assertIn(r.status_code, (101, 500), r.text)
def test_logs(self):