[PR #2510] [MERGED] test(pcap): run the missing-path refusal only where captures are admitted #5287

Closed
opened 2026-10-31 01:05:28 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2510
Author: @kaoru0822-kitauji
Created: 10/13/2026
Status: ✅ Merged
Merged: 10/13/2026
Merged by: @morluto

Base: main ← Head: test/pcap-missing-path-native-bound


📝 Commits (1)

  • 0d25e8f test(pcap): run the missing-path refusal only where captures are admitted

📊 Changes

1 file changed (+16 additions, -11 deletions)

View changed files

📝 tests/boundary/pcap/pcapProviderCrossPlatform.test.ts (+16 -11)

📄 Description

Problem

tests/boundary/pcap/pcapProviderCrossPlatform.test.ts > rejects a path that is not a readable file fails on every macOS run, including clean main:

AssertionError: expected { Object (code, category, ...) } to match object { code: 'invalid_request' }

On hosts without an enforceable native memory bound, PcapProvider deliberately refuses inspect_pcap_capture with capability_unavailable (preparePcapNativeBound) before it reads the capture path. Linux (prlimit) and Windows (Job Objects) are the hosts with such a bound. The same file pins that ordering in reports an unsupported native memory boundary before reading the capture, which runs only when !hasNativeBound. The missing-path test assumed every host gets as far as path validation. CI only runs this file on Linux and Windows, so the conflict never showed there.

Fix

Gate the missing-path test with it.runIf(hasNativeBound), the same condition as the capture-inspection test above it. Production code is unchanged.

Validation

  • On macOS, npm run test:focused -- tests/boundary/pcap/pcapProviderCrossPlatform.test.ts now passes: 4 passed, 2 skipped. Before, it failed 1 of 6.
  • Linux and Windows behavior is unchanged; the test still runs there.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Updated cross-platform test coverage for unreadable capture files. The validation scenario now runs on platforms where native capture inspection is supported, while unsupported-platform behavior is covered separately.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/2510 **Author:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Created:** 10/13/2026 **Status:** ✅ Merged **Merged:** 10/13/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `test/pcap-missing-path-native-bound` --- ### 📝 Commits (1) - [`0d25e8f`](https://github.com/morluto/rea/commit/0d25e8fea6b51e58f70e874fe1c41591598cdf5a) test(pcap): run the missing-path refusal only where captures are admitted ### 📊 Changes **1 file changed** (+16 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `tests/boundary/pcap/pcapProviderCrossPlatform.test.ts` (+16 -11) </details> ### 📄 Description ## Problem `tests/boundary/pcap/pcapProviderCrossPlatform.test.ts > rejects a path that is not a readable file` fails on every macOS run, including clean `main`: ``` AssertionError: expected { Object (code, category, ...) } to match object { code: 'invalid_request' } ``` On hosts without an enforceable native memory bound, `PcapProvider` deliberately refuses `inspect_pcap_capture` with `capability_unavailable` (`preparePcapNativeBound`) before it reads the capture path. Linux (prlimit) and Windows (Job Objects) are the hosts with such a bound. The same file pins that ordering in `reports an unsupported native memory boundary before reading the capture`, which runs only when `!hasNativeBound`. The missing-path test assumed every host gets as far as path validation. CI only runs this file on Linux and Windows, so the conflict never showed there. ## Fix Gate the missing-path test with `it.runIf(hasNativeBound)`, the same condition as the capture-inspection test above it. Production code is unchanged. ## Validation - On macOS, `npm run test:focused -- tests/boundary/pcap/pcapProviderCrossPlatform.test.ts` now passes: 4 passed, 2 skipped. Before, it failed 1 of 6. - Linux and Windows behavior is unchanged; the test still runs there. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Updated cross-platform test coverage for unreadable capture files. The validation scenario now runs on platforms where native capture inspection is supported, while unsupported-platform behavior is covered separately. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:05:28 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#5287
No description provided.