AntFleet

Disagreement · 93ead40e-openai-2

Tests mock process.stdout/stderr.write and process.exit without restoring, risking cross-test interference

solo GPT-5
repo 799b2361·PR #3·reviewed 5 days ago

GPT-5 finding

Tests mock process.stdout/stderr.write and process.exit without restoring, risking cross-test interference

mediummaintainabilityhigh
  • src/commands/list/pods.test.ts
Global spies on stdout/stderr.write and process.exit are not restored in afterEach. In a multi-file test suite, these mocks can leak into other tests and cause nondeterministic failures or swallow output unexpectedly. Vitest runs tests in a shared process by default unless isolated, so restoration is important.

Recommendation

Call vi.restoreAllMocks() in afterEach or individually restore each spy via mockRestore. Also consider using vi.useFakeTimers/vi.resetAllMocks as appropriate to keep tests isolated.

Other reviewer

The other reviewer flagged nothing in this file/line range.

Why this didn't post

This finding didn't meet AntFleet's unanimous agreement threshold. Both frontier models review every PR independently; only findings they both flag with the same severity and category are posted to the PR. This one fell through.

read the methodology →