Skip to content

tests: let name resolution fail immediately in test_gui_start_with_bad_server - #124

Merged
paulmueller merged 1 commit into
DCOR-dev:mainfrom
paulmueller-agent:fix-tests-slow-dns
Nov 4, 2026
Merged

paulmueller merged 1 commit into
DCOR-dev:mainfrom
paulmueller-agent:fix-tests-slow-dns

Conversation

@paulmueller-agent

Copy link
Copy Markdown
Contributor

The Windows test job looked like it was hanging in tests/test_gui.py. With --durations=20 (#123), the last main run (job 126803257463) shows the cause:

1208.83s call     tests/test_gui.py::test_gui_start_with_bad_server

The same test takes 45 s on Linux. During startup and shutdown DCOR-Aid resolves the non-existent host WRONG-dcor-dev.mpl.mpg.de 31 times (each requests call: 1 try + 3 connect retries). The 45 s on Linux are the retry back-off; on Windows each failed lookup adds about 37 s.

Change

  • tests/common.py: new context manager fail_name_resolution(host_part) that lets socket.getaddrinfo raise socket.gaierror immediately for matching hosts
  • tests/test_gui.py: use it in test_gui_start_with_bad_server; the test still checks that DCOR-Aid starts offline

test_cli_fail_wrong_server_httperror (90 s) is left as it is: it takes 90 s on Linux too (retry back-off), and its host *.does.not.exist.example.com does not resolve slowly on Windows.

Testing
test_gui_start_with_bad_server passes locally on Linux (45 s, as before). The Windows timing can only be verified by CI on main.

🤖 Generated with Claude Code

…d_server

On the Windows runners, each lookup of the non-existent host
WRONG-dcor-dev.mpl.mpg.de took about 37 s. DCOR-Aid resolves it 31
times during startup and shutdown, so the test took 20 minutes there
(45 s on Linux), which looked like a hanging test suite.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.77%. Comparing base (3660a9c) to head (28efc73).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #124      +/-   ##
==========================================
+ Coverage   72.70%   72.77%   +0.06%     
==========================================
  Files          72       72              
  Lines        6057     6057              
==========================================
+ Hits         4404     4408       +4     
+ Misses       1653     1649       -4     

☔ View full report in Codecov by Harness.
📢 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.

@paulmueller
paulmueller merged commit 82851e6 into DCOR-dev:main Nov 4, 2026
5 checks passed
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