In-memory MongoDB crashes with SIGSEGV intermittently in apps/api/test/app.test.ts and fails the coverage gate

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
52/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃

调研方向

Start by reading apps/api/test/app.test.ts and the pnpm test:coverage setup to see how the in-memory MongoDB instance starts during parallel runs. The report gives no mongod log or core dump, so investigate whether a safe startup retry is feasible and how coverage failures expose the original crash. Done means the intermittent crash is addressed or its cause and limits are documented, with the full coverage run still enforcing its 100% gate.

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

描述

Area: Infrastructure Bug Needs Info Priority: Low

In one of four local pnpm test:coverage runs, the in-memory MongoDB process crashed while apps/api/test/app.test.ts started. The test file did not run, so coverage fell below 100% and the run failed. The same tree passed in the other three runs, and apps/api/test/app.test.ts passed 2 of 2 times when run alone.

Output

[Nest] ERROR [ExceptionHandler] UnexpectedCloseError: Instance closed unexpectedly with code "null" and signal "SIGSEGV"
    at MongoInstance.closeHandler (.../[email protected]/.../lib/util/MongoInstance.js:335:58)

Error: [vitest-pool]: Worker forks emitted error.
Caused by: Error: Worker exited unexpectedly with signal SIGABRT during started state while running test file apps/api/test/app.test.ts

 Test Files  452 passed (453)
ERROR: Coverage for lines (99.94%) does not meet global threshold (100%)

The files reported as not covered were assignments.module.ts, auth.module.ts, jwt.strategy.ts and gateway.module.ts, which only that test file loads.

Environment

  • Linux 7.3.3-1-cachyos, Intel Core Ultra 7 258V
  • Node v26.13.0, pnpm 10.34.3, vitest 5.0.2
  • mongodb-memory-server 11.3.0, binary mongod-x64-cachyos-7.0.24

What is not known

  • I do not have a core dump or the mongod log, so the cause of the SIGSEGV is not known. It can be specific to this kernel or distribution.
  • I saw it one time. It occurred when the full suite ran in parallel, not when the file ran alone.

One crash of the database makes the full coverage gate fail with a message about coverage, which hides the cause. If this occurs on other machines, a retry of the instance start can be worth adding.

Found while preparing #1904.

主要语言
TypeScript
星标
119
派生
19
平均合并
1 天 18 小时
30 天内合并 PR
60

环境准备

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

从这里开始

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

DouglasNeuroInformatics/OpenDataCapture 的其他 Issue

查看 DouglasNeuroInformatics/OpenDataCapture 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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