Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions data/containers/patches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ docker-py:
# https://github.com/docker/docker-py/pull/3372 - test_connect_with_ipv6_address: enable IPv6
# https://github.com/docker/docker-py/pull/3373 - test_create_with_ipv6_address: enable IPv6
# https://github.com/docker/docker-py/pull/3380 - integration: Remove test_build_squash tests
# https://github.com/docker/docker-py/pull/3393 - tests: Make stream assertions robust to chunk splitting
3261:
3290:
3354:
Expand All @@ -79,6 +80,7 @@ docker-py:
3372:
3373:
3380:
3393:

moby:
# https://github.com/moby/moby/pull/51219 - integration/container: Make tests runnable on SELinux enabled daemon
Expand Down
52 changes: 52 additions & 0 deletions data/containers/patches/docker-py/3393.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
From 41fea2f8923036621c209afebf32c912d5c637e4 Mon Sep 17 00:00:00 2001
From: Ricardo Branco <[email protected]>
Date: Wed, 1 Apr 2026 21:06:10 +0200
Subject: [PATCH] tests: Make stream assertions robust to chunk splitting

When tty=True the output can be split across multiple stream chunks
instead of aligning on line boundaries, making exact chunk membership
checks unreliable.

Verify that the expected messages are present in the combined stream
output rather than at specific chunk boundaries.

Signed-off-by: Ricardo Branco <[email protected]>
---
tests/integration/api_exec_test.py | 20 ++++++--------------
1 file changed, 6 insertions(+), 14 deletions(-)

diff --git a/tests/integration/api_exec_test.py b/tests/integration/api_exec_test.py
index 5b829e2875..15080907c4 100644
--- a/tests/integration/api_exec_test.py
+++ b/tests/integration/api_exec_test.py
@@ -286,13 +286,9 @@ def test_exec_command_tty_stream_no_demux(self):
# tty=True, stream=True, demux=False
res = self.client.exec_create(self.container, self.cmd, tty=True)
exec_log = list(self.client.exec_start(res, stream=True))
- assert b'hello out\r\n' in exec_log
- if len(exec_log) == 2:
- assert b'hello err\r\n' in exec_log
- else:
- assert len(exec_log) == 3
- assert b'hello err' in exec_log
- assert b'\r\n' in exec_log
+ merged = b''.join(chunk for chunk in exec_log)
+ assert b'hello out\r\n' in merged
+ assert b'hello err\r\n' in merged

def test_exec_command_tty_no_stream_demux(self):
# tty=True, stream=False, demux=True
@@ -304,10 +300,6 @@ def test_exec_command_tty_stream_demux(self):
# tty=True, stream=True, demux=True
res = self.client.exec_create(self.container, self.cmd, tty=True)
exec_log = list(self.client.exec_start(res, demux=True, stream=True))
- assert (b'hello out\r\n', None) in exec_log
- if len(exec_log) == 2:
- assert (b'hello err\r\n', None) in exec_log
- else:
- assert len(exec_log) == 3
- assert (b'hello err', None) in exec_log
- assert (b'\r\n', None) in exec_log
+ merged = b''.join(chunk for chunk, _ in exec_log)
+ assert b'hello out\r\n' in merged
+ assert b'hello err\r\n' in merged
2 changes: 0 additions & 2 deletions tests/containers/python_docker.pm
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ sub test ($target) {
"tests.integration.api_container_test.AttachContainerTest::test_attach_no_stream",
# This test with websockets is broken
"tests.integration.api_container_test.AttachContainerTest::test_run_container_reading_socket_ws",
"tests.integration.api_exec_test.ExecDemuxTest::test_exec_command_tty_stream_demux",
"tests.integration.api_exec_test.ExecDemuxTest::test_exec_command_tty_stream_no_demux",
# https://github.com/docker/docker-py/issues/3389
"tests.integration.api_network_test.TestNetworks::test_connect_with_mac_address",
);
Expand Down
Loading