Skip to content

fix(ci): add pytest-timeout to dev deps so nightly stops failing daily#477

Merged
github-actions[bot] merged 3 commits into
mainfrom
fix/nightly-pytest-timeout-dep
May 28, 2026
Merged

fix(ci): add pytest-timeout to dev deps so nightly stops failing daily#477
github-actions[bot] merged 3 commits into
mainfrom
fix/nightly-pytest-timeout-dep

Conversation

@0xmariowu
Copy link
Copy Markdown
Owner

@0xmariowu 0xmariowu commented May 28, 2026

Summary

The Nightly — Live Integration Tests workflow has been failing every single night because pytest --timeout=60 errors with unrecognized arguments: --timeout=60 — the pytest-timeout plugin was never added to the [dev] extras. This adds it.

Root cause

.github/workflows/nightly.yml:33 invokes:

pytest tests/integration/test_free_channels_live.py -m "live and not flaky_live" -v --timeout=60 --ignore=tests/perf -x

--timeout=N is provided by the pytest-timeout plugin. pyproject.toml [project.optional-dependencies].dev listed only pytest, pytest-asyncio, ruff — no pytest-timeout. Pytest exits with code 4 before collecting any test.

Recent failed runs all show the same error (e.g. run 26551922195, 26488064725, 26429718183 — every day this week).

Fix

Single-line addition to [dev] extras: pytest-timeout.

Verification

Local repro with the same venv setup as CI:

pytest tests/integration/test_free_channels_live.py -m "live and not flaky_live" --timeout=60 --collect-only -q
...
15/16 tests collected (1 deselected) in 0.62s

No more unrecognized arguments error.

Test plan

  • CI: nightly.yml (manual workflow_dispatch trigger) shows pytest now starts collecting tests instead of erroring on argv parse.
  • Existing PR-flow CI passes on this branch.

Note on push

Pushed with --no-verify (user-approved) because pre-push runs the full unit suite and a pre-existing flaky test (test_clarify::test_clarifier_returns_question_for_ambiguous_query) fails when run as part of the full suite due to a structlog/stderr capture interaction. It reproduces on origin/main independently of this change. Tracked separately.

Summary by CodeRabbit

  • Chores
    • Added pytest-timeout to development dependencies to improve test reliability.
  • Tests
    • Introduced an automatic test setup/teardown that resets logging between tests to prevent logging-related test flakiness.

Review Change Stack

Copilot AI review requested due to automatic review settings May 28, 2026 09:17
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 755e3647-8758-4d13-abf8-f2f54b0da339

📥 Commits

Reviewing files that changed from the base of the PR and between e2e569b and 51fdf6c.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • tests/conftest.py

📝 Walkthrough

Walkthrough

Adds pytest-timeout to dev extras and an autouse pytest fixture _reset_structlog that calls structlog.reset_defaults() before and after every test; module docstring in tests/conftest.py was simplified.

Changes

Dev Dependency & Test Setup

Layer / File(s) Summary
Add pytest-timeout to dev dependencies
pyproject.toml
pytest-timeout is added to the dev optional dependency list.
Autouse fixture to reset structlog
tests/conftest.py
Adds @pytest.fixture(autouse=True) def _reset_structlog(): ... which calls structlog.reset_defaults() before and after each test; top-level docstring simplified.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I’m a rabbit with a stopwatch, hopping light and spry,
I nudge the tests to hurry so none will slowly die.
Structlog’s cleared at setup, and cleared once tests are done,
Timeouts keep the backlog short — a job well-bounded, fun! 🐇⏰

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding pytest-timeout to dev dependencies to fix nightly CI failures.
Description check ✅ Passed The description provides comprehensive context including the problem, root cause, fix, and verification steps. Most template sections are addressed with clear information.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Warning

Review ran into problems

🔥 Problems

Stopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a @coderabbit review after the pipeline has finished.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the missing pytest-timeout pytest plugin to the project’s dev optional dependencies so CI workflows that invoke pytest --timeout=... (notably the nightly live integration tests) no longer fail at argument parsing.

Changes:

  • Add pytest-timeout to [project.optional-dependencies].dev in pyproject.toml.

@github-actions
Copy link
Copy Markdown
Contributor

@copilot please address the blocking signals on this PR and push a fix commit.

Trigger: ci-failure
Details: Workflow "CI" failed on run 26565951983

Follow the PR's .github/copilot-instructions.md hard rules. Do not suppress lints, skip tests, or weaken CI.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e2e569b485

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pyproject.toml
@github-actions github-actions Bot enabled auto-merge (squash) May 28, 2026 09:19
@0xmariowu
Copy link
Copy Markdown
Owner Author

Addressed the uv.lock review feedback in commit 51fdf6c — ran uv lock to regenerate, added pytest-timeout==2.4.0 to the lockfile.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

Actionable comments posted: 0

@github-actions github-actions Bot merged commit 9769da5 into main May 28, 2026
17 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