[PR #4642] [MERGED] test: fix flaky test #5499

Closed
opened 2026-03-13 12:25:06 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4642
Author: @himself65
Created: 9/14/2025
Status: Merged
Merged: 9/14/2025
Merged by: @himself65

Base: canaryHead: himself65/2025/09/13/falky


📝 Commits (3)

  • 3aa82b5 test: fix flaky test
  • f3a8a12 test: fix flaky test
  • fd2519c Merge branch 'canary' into himself65/2025/09/13/falky

📊 Changes

1 file changed (+82 additions, -28 deletions)

View changed files

📝 packages/better-auth/src/adapters/test.ts (+82 -28)

📄 Description

Fixes: https://github.com/better-auth/better-auth/issues/4639
Fixes: https://github.com/better-auth/better-auth/issues/4640

Summary by cubic

Stabilizes adapter tests by generating per-run unique emails and seeding local data for string-operator queries to eliminate cross-test collisions. Fixes intermittent failures in parallel runs.

  • Bug Fixes
    • Added testRunId and getUniqueEmail helper; replaced hardcoded emails across tests, including number-id adapter tests.
    • Updated updateMany test to use the current email and a new target email to avoid clashes with prior updates.
    • Seeded users within starts_with/ends_with tests; adjusted queries and assertions (e.g., value "user", length >= 3, suffix "ter2").
    • Switched user to let to allow updates during tests.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/4642 **Author:** [@himself65](https://github.com/himself65) **Created:** 9/14/2025 **Status:** ✅ Merged **Merged:** 9/14/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/09/13/falky` --- ### 📝 Commits (3) - [`3aa82b5`](https://github.com/better-auth/better-auth/commit/3aa82b5da7cf8ebddfaa71c49ecc2bbb2670ca5e) test: fix flaky test - [`f3a8a12`](https://github.com/better-auth/better-auth/commit/f3a8a1249fcdd6ffaa46284b74cff380e75ab6b8) test: fix flaky test - [`fd2519c`](https://github.com/better-auth/better-auth/commit/fd2519c6892384068a08c79d774f0eeb7df11977) Merge branch 'canary' into himself65/2025/09/13/falky ### 📊 Changes **1 file changed** (+82 additions, -28 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/adapters/test.ts` (+82 -28) </details> ### 📄 Description Fixes: https://github.com/better-auth/better-auth/issues/4639 Fixes: https://github.com/better-auth/better-auth/issues/4640 <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Stabilizes adapter tests by generating per-run unique emails and seeding local data for string-operator queries to eliminate cross-test collisions. Fixes intermittent failures in parallel runs. - Bug Fixes - Added testRunId and getUniqueEmail helper; replaced hardcoded emails across tests, including number-id adapter tests. - Updated updateMany test to use the current email and a new target email to avoid clashes with prior updates. - Seeded users within starts_with/ends_with tests; adjusted queries and assertions (e.g., value "user", length >= 3, suffix "ter2"). - Switched user to let to allow updates during tests. <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 12:25:06 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#5499