Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions packages/compass-e2e-tests/tests/no-network-traffic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('networkTraffic: false / Isolated Edition', function () {
const wrapperFile = path.join(tmpdir, 'wrap.sh');
await fs.writeFile(
wrapperFile,
`#!/bin/bash\nulimit -c 0; exec strace -f -e connect -qqq -o '${outfile}' '${binary}' "$@"\n`
`#!/bin/bash\nulimit -c 0; exec strace -f -e connect -tt -o '${outfile}' '${binary}' "$@"\n`
);
await fs.chmod(wrapperFile, 0o755);
return wrapperFile;
Expand Down Expand Up @@ -115,12 +115,15 @@ describe('networkTraffic: false / Isolated Edition', function () {
);
}

if (
[...connectTargets].some(
(target) => !/^127.0.0.1:|^\[::1\]:/.test(target)
)
) {
throw new Error(`Connected to unexpected host! ${[...connectTargets]}`);
const unexpectedHosts = [...connectTargets].filter(
(target) => !/^127.0.0.1:|^\[::1\]:/.test(target)
);
if (unexpectedHosts.length > 0) {
throw new Error(
`Connected to unexpected host! ${[
...unexpectedHosts,
]}. Here is the strace log:\n ${straceLog}`
);
}
if (![...connectTargets].some((target) => /:27091$/.test(target))) {
throw new Error(
Expand Down
Loading