- Executed unit tests (passed). - Detected flakiness in subsequent test runs (timeout). - Performed static analysis (zero assertions, timing, console usage). - Generated test audit report and saved to `artifacts/`. - Updated test logs and flakiness matrix. Co-authored-by: PR0M3TH3AN <[email protected]>
5.1 KiB
Test Log 2026-02-24
Command: npm run test:unit Full log saved to: test-audit/unit-test-run.log (gitignored)
Last 100 lines of output:
Subtest: VideoSettingsMenuController - closeMenu closes popover
ok 2 - VideoSettingsMenuController - closeMenu closes popover
duration_ms: 0.422664 type: 'test' ...
Subtest: VideoSettingsMenuController - requestMenu toggles if open
ok 3 - VideoSettingsMenuController - requestMenu toggles if open
duration_ms: 0.282361 type: 'test' ...
Subtest: VideoSettingsMenuController - closeAll closes all popovers
ok 4 - VideoSettingsMenuController - closeAll closes all popovers
duration_ms: 0.473886 type: 'test' ... 1..4
tests 4
suites 0
pass 4
fail 0
cancelled 0
skipped 0
todo 0
duration_ms 15.318827
→ Running tests/webtorrent-handlers.test.mjs TAP version 13
Subtest: TorrentClient Handlers
# Subtest: handleTorrentStream (chrome) should set up video correctly
ok 1 - handleTorrentStream (chrome) should set up video correctly
---
duration_ms: 21.117274
type: 'test'
...
| ok 2 - handleTorrentStream (firefox) should set up video correctly with highWaterMark |
|---|
| duration_ms: 20.907886 |
| type: 'test' |
| ... |
| # Subtest: handleTorrentStream (chrome) should handle CORS warning logic |
| ok 3 - handleTorrentStream (chrome) should handle CORS warning logic |
| --- |
| duration_ms: 1.320234 |
| type: 'test' |
| ... |
| 1..3 |
| ok 1 - TorrentClient Handlers |
[bitvid] CORS warning detected. Attempting to remove the failing webseed/tracker. [bitvid] Cleaned up webseeds => [ 'http://good.com/video.mp4' ] [bitvid] Cleaned up trackers => [ 'ws://good.com' ] # Subtest: handleTorrentStream (firefox) should set up video correctly with highWaterMark
duration_ms: 45.425269 type: 'suite' ... 1..1
tests 3
suites 1
pass 3
fail 0
cancelled 0
skipped 0
todo 0
duration_ms 59.663698
→ Running tests/webtorrent-regression.test.mjs TAP version 13
Subtest: WebTorrent Regression Tests
# Subtest: probePeers should report healthy if webseed is present even with 0 peers
ok 1 - probePeers should report healthy if webseed is present even with 0 peers
---
duration_ms: 7.965928
type: 'test'
...
# Subtest: probePeers should report unhealthy if no webseed and 0 peers
ok 2 - probePeers should report unhealthy if no webseed and 0 peers
---
duration_ms: 51.301294
type: 'test'
...
1..2
ok 1 - WebTorrent Regression Tests
duration_ms: 61.785594 type: 'suite' ... 1..1
tests 2
suites 1
pass 2
fail 0
cancelled 0
skipped 0
todo 0
duration_ms 69.636843
✔ All unit tests passed
Test Audit Report: 2026-02-24
Summary
- Date: 2026-02-24
- Agent: test-audit-agent
- Command:
npm run test:unit - Result: PASSED (Initial Run)
- Flakiness: DETECTED (Failure in subsequent run)
Test Execution
The unit test suite was executed using the native Node.js test runner (scripts/run-unit-tests.mjs).
- Initial Run: Passed (Duration: ~70s)
- Log:
test_logs/TEST_LOG_2026-02-24.md
Flakiness Detection
The suite was re-run to detect flakiness.
- Iterations Planned: 3
- Iterations Completed: 1 (Timed out after 340s)
- Result: FAILED
- Details: The first iteration of the flakiness check failed and took significantly longer (340s) than the initial run (70s), indicating severe resource contention or non-deterministic behavior that causes hangs/timeouts.
Static Analysis & Suspicious Tests
Zero Assertions
The following test files contain describe/test blocks but no standard assertion keywords (expect, assert, etc.). These may be "execution only" tests or use custom assertions not detected by the heuristic.
tests/e2e/cache-upgrade-smoke.spec.tstests/embed_playback_check.spec.mjstests/minimal-webtorrent.test.mjstests/ui/components/debug_hashtag_strip_helper.test.mjstests/visual/reduced-motion.spec.ts
Skipped Tests
tests/nostr/sessionActor.test.mjs: Line 20 -t.skip("WebCrypto not available in this environment")
Anti-Patterns
- Timing Dependence: 100+ occurrences of
setTimeout,sleep, ordelayfound. This suggests tests are relying on real time, which contributes to the observed slowness and flakiness. - Console Usage: 100+ occurrences of
console.log/warn/errorin source and tests.
Coverage
Code coverage metrics are currently unavailable because the project uses vitest in devDependencies but the custom scripts/run-unit-tests.mjs runner (using node:test) does not invoke it or pass --experimental-test-coverage.
Remediation Plan
- Investigate Flakiness: The discrepancy between the initial pass (70s) and the subsequent fail/timeout (340s) is critical. Investigate
tests/minimal-webtorrent.test.mjsand other tests relying on network/timers. - Fix Zero Assertions: Review the 5 files listed above. Add explicit assertions.
- Reduce Console Noise: Clean up
console.logcalls in tests to reduce I/O overhead. - Enable Coverage: Update
scripts/run-unit-tests.mjsto support coverage collection.