Closed t3hmrman closed 5 months ago
Are you running your tests concurrently? I wouldn't be surprised if there are race conditions within the docker
CLI. I ran into some myself. You can try using the experimental HTTP client that talks to the docker daemon directly.
Ah, so if this is a known issue then is the way to resolve this just to add some documentation to recommend switching to the experimental HTTP client method for now?
Ah, so if this is a known issue then is the way to resolve this just to add some documentation to recommend switching to the experimental HTTP client method for now?
I didn't say that it is a known issue but you can try the experimental client to narrow down which component causes the issue.
As always thanks for the awesome library, it's been incredibly useful for testing.
I've been doing some stress-testing on my test suite (i.e. running the tests continuously until one failed) lately and found that sometimes the
Cli
actually fails to perform some lower leveldocker
CLI commands.The first failure I encountered was a failure with creating a container, but unfortunately I didn't have
--nocapture
on, so I couldn't get the output. After repeating the process I found that I got a failure:I've anonymized the details of the project and test suite, but it should be clear that the failure was inside (but not the fault of)
testcontainers
.Looking at the output of my
docker
systemd service, I see a failure to write stderr (emphasis via spacing added below):After this error came up I restarted the test suite and it worked just fine -- the lower level failure seems transient.
Does it make sense to add error detection and/or a dumb retry policy at this level to the underlying client? I'm not sure if there's a better way to handle this, and unfortunately I didn't increase the log level on
docker
so it wasn't more specific on why it failed (like it has been for others).