Investigate integration test failures when temporary space schemas disappear

未关闭
#255 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
postgresql, typescript

调研方向

Start with packages/server/device-flow.integration.test.ts and the integration test command configured to run files with --parallel=2; compare the failures against the linked CI logs. Reproduce the missing-schema error and identify the failing query or add an equivalent regression test. Done means the race is fixed or tests are isolated without hiding failures, repeated integration runs pass, and the production startup risk is assessed.

由索引模型根据 Issue 内容生成。

描述

Problem

The integration CI job fails intermittently while initializing Better Auth in the device authorization tests. PostgreSQL reports that a temporary me_<slug> schema does not exist. This blocks CI even for unrelated changes.

Examples:

  • main CI run: device-code requests are rate limited failed with a missing space schema.
  • changelog PR CI run: the trailing-slash verification URL test and the rate-limit test failed with the same class of error.

Investigation so far

  • Integration test files run with --parallel=2 against one PostgreSQL database. They create and drop separate temporary auth, core, and space schemas.
  • The affected tests create new Better Auth instances in packages/server/device-flow.integration.test.ts. Better Auth 1.7 uses Kysely to inspect database tables across schemas during initialization.
  • Likely race: another test drops a temporary space schema while that database-wide inspection is running. The logs do not identify the exact failing query, so this remains a hypothesis.
  • The same CI integration command passed locally with 467 tests. Full local checks also passed. The failure may depend on timing.
  • Similar schema creation or deletion during application startup could matter outside tests; determine whether this is a production risk rather than assuming it is test-only.

Done when

  • Identify and reproduce the root cause, including the failing query or an equivalent regression test.
  • Fix the race or otherwise isolate the integration tests without masking real failures.
  • Verify the integration suite repeatedly and confirm whether production startup needs a separate fix.

Running integration files serially may be a temporary workaround, but it would slow CI and would not necessarily address production startup.

主要语言
TypeScript
星标
43
派生
3
平均合并
6 小时 30 分钟
30 天内合并 PR
11

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。