Skip to content

fix(test): stop asserting exact elapsed time in wait timeout tests - #3795

Merged
EmilyRagan merged 1 commit into
mainfrom
fix-flaky-wait-expression-test
Sep 2, 2026
Merged

EmilyRagan merged 1 commit into
mainfrom
fix-flaky-wait-expression-test

Conversation

@EmilyRagan

Copy link
Copy Markdown
Contributor

What changed

Removed the exact elapsed-time value from four timeout assertions in openc3/python/test/api/test_api_shared.py. They now assert on "... after waiting" instead of "... after waiting 0.1".

Why it changed

TestApiShared::test_waits_for_an_expression failed on the Python 3.14 job of run 33422678518:

AssertionError: 'WAIT: True == False is FALSE after waiting 0.1' not found in
'WAIT: True == True is TRUE after waiting 0.000 seconds\nWARN: WAIT: True == False is FALSE after waiting 0.242 seconds\n'

The assertions compared the printed elapsed seconds against the requested timeout. On a slow runner the polling loop overshoots the timeout, so the printed value (0.242) no longer starts with the timeout value (0.1). The elapsed time is not what these tests are verifying — the sibling test_waits_for_a_logical_expression already asserts without the number.

This is a pre-existing flake on main, not introduced by #3794.

Testing strategy

uv run pytest test/api/test_api_shared.py — 44 passed.

🤖 Generated with Claude Code

Timeout assertions matched the printed elapsed seconds against the
timeout value (e.g. "after waiting 0.1"), which fails on slow CI
runners where the poll loop overshoots (observed 0.242s on Python
3.14). Drop the elapsed value from the assertions, matching the
existing style in test_waits_for_a_logical_expression.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Aug 31, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.16%. Comparing base (2adf7b0) to head (b75e06b).
⚠️ Report is 17 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3795      +/-   ##
==========================================
- Coverage   79.17%   79.16%   -0.01%     
==========================================
  Files         894      894              
  Lines       66949    66949              
  Branches     2600     2552      -48     
==========================================
- Hits        53009    53003       -6     
- Misses      13276    13283       +7     
+ Partials      664      663       -1     
Flag Coverage Δ
frontend 66.00% <ø> (-0.05%) ⬇️
python 79.29% <ø> (-0.01%) ⬇️
ruby-api 82.32% <ø> (+0.04%) ⬆️
ruby-backend 84.48% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud

Copy link
Copy Markdown

@EmilyRagan EmilyRagan self-assigned this Aug 31, 2026
@EmilyRagan
EmilyRagan marked this pull request as ready for review August 31, 2026 18:53
@EmilyRagan EmilyRagan added the python Pull requests that update Python code label Sep 2, 2026
@EmilyRagan
EmilyRagan merged commit 6affc24 into main Sep 2, 2026
36 checks passed
@EmilyRagan
EmilyRagan deleted the fix-flaky-wait-expression-test branch September 2, 2026 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants