Skip to content

fix(test): mock IsolatedContainerVolume in naabu tests to prevent flaky timeouts#295

Merged
LuD1161 merged 1 commit intomainfrom
fix/flaky-naabu-test
Feb 17, 2026
Merged

fix(test): mock IsolatedContainerVolume in naabu tests to prevent flaky timeouts#295
LuD1161 merged 1 commit intomainfrom
fix/flaky-naabu-test

Conversation

@LuD1161
Copy link
Contributor

@LuD1161 LuD1161 commented Feb 17, 2026

Summary

  • Fixes flaky naabu tests that intermittently timed out during pre-push hooks

Root Cause

component.execute() triggers real Docker commands via IsolatedContainerVolume — even when runComponentWithRunner is already mocked:

  1. docker volume create — creates an isolated volume
  2. docker run alpine — writes targets.txt into the volume
  3. docker run alpinechmod -R 777 on the volume
  4. docker volume rm — cleanup

When Docker is cold or slow, these operations exceed the 5s test timeout, causing flaky failures like:

  • this test timed out after 5000ms
  • ContainerError: Failed to initialize isolated volume: Failed to set volume permissions: exit code 143

Fix

Added mock.module for IsolatedContainerVolume in naabu.test.ts. This follows the same pattern already used in:

  • dnsx.test.ts (line 5)
  • opencode.test.ts (line 9)

The naabu test was the only component test missing this mock.

The mock is scoped to the test file (Bun's mock.module behavior), so it does not affect other tests. The full execute logic (argument building, output parsing, analytics result generation) is still exercised — only the Docker I/O layer is skipped.

Test plan

  • All 766 tests pass (648 pass, 118 skip, 0 fail)
  • Naabu tests specifically: 5 pass, 0 fail, completes in ~3s
  • Verified mock doesn't affect other test files

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 110b912642

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…ky timeouts

The naabu tests were flaky because component.execute() triggers real
Docker commands via IsolatedContainerVolume (volume create, alpine
container for file writes/chmod, volume rm) even when
runComponentWithRunner is mocked. When Docker is cold or slow, these
operations exceed the test timeout.

This follows the same pattern already used in dnsx.test.ts and
opencode.test.ts.

Signed-off-by: Aseem Shrey <LuD1161@users.noreply.github.com>
@LuD1161 LuD1161 force-pushed the fix/flaky-naabu-test branch from 110b912 to 2c56a9f Compare February 17, 2026 00:46
@LuD1161 LuD1161 merged commit 05ce1ee into main Feb 17, 2026
3 checks passed
@LuD1161 LuD1161 deleted the fix/flaky-naabu-test branch February 17, 2026 00:50
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.

1 participant

Comments