Skip to content

fix flaky cookie sharing test#1310

Merged
BilalG1 merged 4 commits into
devfrom
fix/cookie-test-timeout
Apr 7, 2026
Merged

fix flaky cookie sharing test#1310
BilalG1 merged 4 commits into
devfrom
fix/cookie-test-timeout

Conversation

@BilalG1
Copy link
Copy Markdown
Collaborator

@BilalG1 BilalG1 commented Apr 6, 2026

Temporarily repeat the cross-subdomain cookie test 10 times to verify CI stability. Increased waitUntil timeout from 10s to 30s to account for network retry exponential backoff.

Summary by CodeRabbit

Release Notes

This pull request contains internal testing infrastructure updates only. A test timeout value was adjusted to improve test reliability. No user-visible changes or new features are included in this release.

Temporarily repeat the cross-subdomain cookie test 10 times to verify
CI stability. Increased waitUntil timeout from 10s to 30s to account
for network retry exponential backoff.
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
stack-auth-hosted-components Ready Ready Preview, Comment Apr 7, 2026 4:32pm
stack-backend Ready Ready Preview, Comment Apr 7, 2026 4:32pm
stack-dashboard Ready Ready Preview, Comment Apr 7, 2026 4:32pm
stack-demo Ready Ready Preview, Comment Apr 7, 2026 4:32pm
stack-docs Ready Ready Preview, Comment Apr 7, 2026 4:32pm

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ade2b775-7374-470b-855c-d9230357f3d5

📥 Commits

Reviewing files that changed from the base of the PR and between 37a69b0 and 693c8b9.

📒 Files selected for processing (1)
  • apps/e2e/tests/js/cookies.test.ts

📝 Walkthrough

Walkthrough

A test timeout in apps/e2e/tests/js/cookies.test.ts was increased from 10 seconds to 30 seconds for the cross-subdomain cookie creation detection assertion, extending the wait window for asynchronous cookie operations.

Changes

Cohort / File(s) Summary
Test Timeout Extension
apps/e2e/tests/js/cookies.test.ts
Increased waitUntil timeout from 10,000 ms to 30,000 ms for detecting cross-subdomain cookie creation in the "should eagerly create cross-subdomain cookie on construction when session exists but custom cookie is missing" test case.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested reviewers

  • N2D4

Poem

🐰 A patient rabbit hops with glee,
Waiting longer for cookies to be,
Thirty seconds instead of ten,
Gives time for magic to happen, and then ✨
Cross-domain treats flow free!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: increasing a test timeout to fix a flaky test. It is concise, clear, and directly related to the primary modification in the changeset.
Description check ✅ Passed The description explains the timeout change and its rationale (network retry backoff). It follows the basic template structure by including the CONTRIBUTING.md reminder, though it's brief.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/cookie-test-timeout

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.

@BilalG1 BilalG1 marked this pull request as ready for review April 6, 2026 21:56
@BilalG1 BilalG1 changed the title test: repeat eager cookie test 10x with increased timeout fix flaky cookie sharing test Apr 6, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 6, 2026

Greptile Summary

This PR increases the waitUntil timeout for the cross-subdomain eager cookie test from 10 s to 30 s to account for network retry exponential backoff. The change is safe and scoped to a single test line. Two minor P2 observations are noted inline: the PR description mentions repeating the test 10× but no repetition logic is present in the code, and the change is described as temporary with no TODO to track reverting it.

Confidence Score: 5/5

Safe to merge — change is isolated to a test timeout and does not affect production code.

All findings are P2 style/cleanup suggestions with no correctness or reliability impact. The single changed line is a straightforward timeout increase in a test file.

No files require special attention; apps/e2e/tests/js/cookies.test.ts is the only changed file.

Important Files Changed

Filename Overview
apps/e2e/tests/js/cookies.test.ts Single-line timeout increase (10s → 30s) on waitUntil for cross-subdomain cookie recreation after simulated page reload

Sequence Diagram

sequenceDiagram
    participant Test
    participant StackClientApp
    participant CookieStore
    participant Backend

    Test->>StackClientApp: signUpWithCredential()
    StackClientApp->>Backend: POST /api/v1/auth/signup
    Backend-->>StackClientApp: refresh_token
    StackClientApp->>CookieStore: set default + custom cookie

    Test->>Test: delete customCookie, set only defaultCookie
    Test->>StackClientApp: new StackClientApp() (page reload simulation)
    StackClientApp->>Backend: exchange default refresh_token (with retries)
    Backend-->>StackClientApp: session valid
    StackClientApp->>CookieStore: eagerly write customCookie

    Test->>CookieStore: waitUntil(has(customCookie), 30s)
    CookieStore-->>Test: true
Loading
Prompt To Fix All With AI
This is a comment left during a code review.
Path: apps/e2e/tests/js/cookies.test.ts
Line: 423

Comment:
**PR description mentions 10x repetition not implemented**

The PR description says the test is "temporarily repeat[ed] 10 times to verify CI stability," but the diff only increases the timeout — there is no loop or repeat logic anywhere in the file. If repetition was intended to catch intermittent failures, consider wrapping the test body in a loop or using a test-framework retry utility before merging.

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: apps/e2e/tests/js/cookies.test.ts
Line: 423

Comment:
**No TODO for temporary change**

The PR description explicitly calls this change "temporary," but the code has no `// TODO:` or tracker reference to signal that the 30 s timeout should be reverted once CI stability is confirmed. Without a marker, this inflated timeout is likely to stay indefinitely.

```suggestion
  const customRecreated = await waitUntil(() => cookieStore.has(customCookieName), 30_000); // TODO: revert to 10_000 after CI stability is confirmed
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "Remove test loop, keep increased waitUnt..." | Re-trigger Greptile

Comment thread apps/e2e/tests/js/cookies.test.ts
Comment thread apps/e2e/tests/js/cookies.test.ts
@BilalG1 BilalG1 requested a review from N2D4 April 7, 2026 00:12
@BilalG1 BilalG1 assigned N2D4 and unassigned BilalG1 Apr 7, 2026
@github-actions github-actions Bot assigned BilalG1 and unassigned N2D4 Apr 7, 2026
@BilalG1 BilalG1 merged commit 8e14c9e into dev Apr 7, 2026
27 of 31 checks passed
@BilalG1 BilalG1 deleted the fix/cookie-test-timeout branch April 7, 2026 16:30
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