Skip to content

test(agent-core): give the sweep-resilience wait the full test budget - #142

Merged
elkaix merged 1 commit into
mainfrom
fix/flaky-oauth-sweep-test
Aug 22, 2026
Merged

test(agent-core): give the sweep-resilience wait the full test budget#142
elkaix merged 1 commit into
mainfrom
fix/flaky-oauth-sweep-test

Conversation

@elkaix

@elkaix elkaix commented Aug 22, 2026

Copy link
Copy Markdown
Member

Related Issue

None — test-stability fix (internal PR).

Problem

McpOAuthService sweepProactiveRefresh resilience > skips malformed meta sidecars flaked on a loaded CI runner today and blocked the release gate: the immediate refresh spans two localhost HTTP round-trips plus token writes, but waitFor used a hard-coded 5s deadline while the test itself allows 15s. One gh run rerun --failed cleared it, but it will bite future releases the same way.

What changed

waitFor now takes an optional budget (default unchanged at 5s), and the sweep-resilience wait uses 12s — inside the test's own 15s timeout, with margin for cleanup. No production code touched.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue (internal stability fix).
  • I have added tests that prove my feature works (the test itself is the change; scoped run passes 20/20).
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

Summary by CodeRabbit

  • Tests
    • Improved test reliability by allowing asynchronous checks to use configurable wait periods.
    • Extended the proactive refresh resilience test’s wait window while preserving its overall timeout.

@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d9062f01-a7b7-4a93-a6b6-e13963af3acc

📥 Commits

Reviewing files that changed from the base of the PR and between 9c5604d and becb258.

📒 Files selected for processing (1)
  • packages/agent-core/test/mcp/oauth-service.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The OAuth service test helper now accepts a configurable timeout. The proactive-refresh resilience test uses a 12-second wait while retaining its 15-second test timeout.

Changes

OAuth test resilience

Layer / File(s) Summary
Configurable refresh wait budget
packages/agent-core/test/mcp/oauth-service.test.ts
waitFor accepts an optional timeout and defaults to 5 seconds. The malformed-sidecar proactive-refresh test uses a 12-second wait within its 15-second test timeout.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Merge Risk: ⚪ Minimal · up to becb2

This change only gives the flaky resilience test a larger wait budget while leaving the default behavior unchanged; no actionable merge-blocking risk remains after normal checks and review.

🚥 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%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. 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 uses the required test prefix, imperative mood, and stays within 72 characters while describing the wait-budget change.
Description check ✅ Passed The description covers the problem, implementation, testing, checklist, and internal-PR issue context.
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.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch

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

@pkg-pr-new

pkg-pr-new Bot commented Aug 22, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@pymodel/pythinker-code@becb258
npx https://pkg.pr.new/@pymodel/pythinker-code@becb258

commit: becb258

@elkaix
elkaix merged commit b04d937 into main Aug 22, 2026
19 of 20 checks passed
@elkaix
elkaix deleted the fix/flaky-oauth-sweep-test branch August 22, 2026 09:08
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.

1 participant