Skip to content

test(pcap): expect the producer's final stdout newline - #3257

Closed
N0zoM1z0 wants to merge 1 commit into
mainfrom
fix/pcap-cleanup-stdout-newline-20261014
Closed

N0zoM1z0 wants to merge 1 commit into
mainfrom
fix/pcap-cleanup-stdout-newline-20261014

Conversation

@N0zoM1z0

@N0zoM1z0 N0zoM1z0 commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Match the capinfos stub's actual final newline in the retained-cleanup regression test. This one-line expectation correction restores a test that currently blocks unrelated PRs, including #3108.

Problem and expected behavior

The stub prints printf '%s\n', but the assertion expected CAPINFOS_OUTPUT without its trailing newline. The assertion failed before mayClean = true, leaving the injected cleanup failure active during finalization. Production correctly preserves the raw stdout.

Change and scope

Expect ${CAPINFOS_OUTPUT}\n for capinfos; preserve the existing tshark expectation and every observation, resource ownership, and cleanup assertion. No production code, retries, skips, or CI gates change. Ordinary test correction; a new capability scope decision is not applicable.

Contract and boundary impact

  • Semantic owner: production output preservation remains unchanged; the test oracle now matches its own producer.
  • CLI/MCP, Evidence, provider, platform, generated metadata and installation contracts: unchanged.
  • Test effects: existing disposable files and synthetic subprocesses only. No real capture, target application, instrumentation, protection recovery or network service.

Evidence and validation

  • Original CI failure: one failure / 1,178 passes / 22 skips. Other shards were cancelled, not passed.
  • Clean integrated main 7375ab6e3: exact PCAP file reproduces 19 passes / one failure. Applying only this expectation correction passes all 20 tests.
  • Fresh latest-main base 877d40408: npm run test:focused -- tests/boundary/pcap/pcapProvider.test.ts passes all 20 tests; npm run check:fast and git diff --check pass. Two-CPU/8-GiB guard, peak 4,415 MiB, no guard stop.
  • Current-head real TShark CI passes 70 tests across eight files and 23 CLI/MCP verifier cases using real TShark/capinfos with synthetic Ethernet/IPv4/UDP/DNS and Bluetooth HCI PCAPs. No hardware acquisition or native Windows/macOS claim.
  • Static checks, source tests, package build and Greptile pass; five complete boundary shards remain running/queued. Required current-head CI remains the merge gate.

Compatibility and release

No user-visible behavior, dependency, package metadata or release change. No additional regression test is added because the existing one provides the required oracle. No generated outputs or local artifacts are committed.

Before merge

Match the capinfos stub's actual printf output in the retained-cleanup
regression. Keep raw output, partial observations, and cleanup assertions
unchanged so the test can reach the explicit recovery and release its owner.

Clean integrated main reproduces 19 passes and one failed assertion; the
one-line expectation correction passes all 20 cases on Linux. No production
behavior or test gate is changed.

Co-authored-by: Kaoru0822 <[email protected]>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Low impact] This correction appears safe to merge.

Summary

Corrects the retained-cleanup test to expect the final newline printed by the capinfos stub.

  • The retained-cleanup test expects capinfos's final newline.

Reviews (1) · Last reviewed commit: "test(pcap): expect the producer's final ..." · Reviewed by Greptile

@N0zoM1z0

Copy link
Copy Markdown
Collaborator Author

Main now incorporates the same stdout correction in 1341e8c83, together with a useful finalizer safeguard that releases the injected cleanup failure even if an assertion fails.

I verified a clean current-main checkout at 29d3dcb7e: the complete PCAP provider file passes all 20 tests on Linux. This PR's static/source/build, Greptile and real TShark lane also passed (70 tests and 23 CLI/MCP verifier cases), but its full shard run is unfinished and will be cancelled as superseded. Closing this duplicate: the required repair is already integrated, and #3108 is being synchronized with that main revision for fresh CI. Thanks for the upstream fix.

@N0zoM1z0 N0zoM1z0 closed this Oct 14, 2026
@morluto morluto added area: tests Test suite and verification area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Oct 14, 2026
@morluto

morluto commented Oct 15, 2026

Copy link
Copy Markdown
Owner

Thanks @N0zoM1z0 for correcting the PCAP cleanup test to match capinfos' final newline. Main now keeps that producer-shaped assertion alongside a finalizer safeguard in the same provider test suite (main).

@morluto morluto added area: cli CLI adapter and one-shot commands provider: pcap Analysis provider / engine: pcap labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli CLI adapter and one-shot commands area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior area: tests Test suite and verification provider: pcap Analysis provider / engine: pcap

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants