Skip to content

fix(core): add container logs to TimeoutError when wait strategy times out#1007

Open
ticapix wants to merge 2 commits into
testcontainers:mainfrom
ticapix:main
Open

fix(core): add container logs to TimeoutError when wait strategy times out#1007
ticapix wants to merge 2 commits into
testcontainers:mainfrom
ticapix:main

Conversation

@ticapix
Copy link
Copy Markdown

@ticapix ticapix commented Apr 15, 2026

Hello,

Thanks for testcontainers !

I had a lot of trouble to understand why my docker strategy was timing out and I ended up patching the code like in this PR to get the container logs when there is a timeout.

I hope it can help others when debugging.

make tests runs ok

Happy to update the PR if needed

@alexanderankin
Copy link
Copy Markdown
Member

not sure why the cicd is not running 👀

@alexanderankin alexanderankin changed the title add container logs to TimeoutError when wait strategy times out fix(core): add container logs to TimeoutError when wait strategy times out May 18, 2026
@alexanderankin
Copy link
Copy Markdown
Member

core/testcontainers/core/container.py:223: error: "TimeoutError" has no
attribute "add_note" [attr-defined]
ex.add_note(self._container.logs().decode())
^~~~~~~~~~~
Found 1 error in 1 file (checked 45 source files)

@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.04%. Comparing base (23aca0b) to head (441e473).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1007      +/-   ##
==========================================
- Coverage   83.05%   83.04%   -0.02%     
==========================================
  Files          16       16              
  Lines        1700     1728      +28     
  Branches      186      190       +4     
==========================================
+ Hits         1412     1435      +23     
- Misses        234      236       +2     
- Partials       54       57       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants