Skip to content

fix(python): start clock before connect in template protocol delay test - #4161

Closed
EmilyRagan wants to merge 1 commit into
mainfrom
fix/template-protocol-delay-test-flake
Closed

EmilyRagan wants to merge 1 commit into
mainfrom
fix/template-protocol-delay-test-flake

Conversation

@EmilyRagan

Copy link
Copy Markdown
Contributor

Summary

  • test_waits_before_writing_during_the_initial_delay_period flaked in CI (0.0196 not greater than or equal to 0.02, failed run).
  • TemplateProtocol.connect() sets connect_complete_time to the connect time plus the initial delay, but the test started its clock after connect() returned. The write could therefore wait slightly less than the full delay as measured.
  • Start the clock before connect() so the measurement covers the whole delay.

Test-only change; no protocol behavior changes.

Test plan

  • uv run pytest test/interfaces/protocols/test_template_protocol.py (22 passed)

🤖 Generated with Claude Code

The initial delay is measured from connect, but the test started its
clock after connect returned. The write then waited slightly less than
the full delay as measured, so the >= 0.02 assertion flaked on CI.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 26, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.33%. Comparing base (5fc49ea) to head (72ca56f).
⚠️ Report is 116 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4161      +/-   ##
==========================================
+ Coverage   79.82%   80.33%   +0.50%     
==========================================
  Files         907      911       +4     
  Lines       70041    70779     +738     
  Branches     2687     2688       +1     
==========================================
+ Hits        55912    56862     +950     
+ Misses      13463    13244     -219     
- Partials      666      673       +7     
Flag Coverage Δ
frontend 68.48% <ø> (+1.21%) ⬆️
python 78.83% <ø> (+0.36%) ⬆️
ruby-api 83.45% <ø> (+<0.01%) ⬆️
ruby-backend 86.48% <ø> (+0.36%) ⬆️

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

@ryanmelt

Copy link
Copy Markdown
Member

Dup of #4155

@ryanmelt ryanmelt closed this Oct 26, 2026
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