Skip to content

Commit

Permalink
Add TCP dump test (#2155)
Browse files Browse the repository at this point in the history
* Add TCP dump test

* A better kill
  • Loading branch information
soulgalore authored Jul 7, 2024
1 parent 3756a86 commit 1ce5971
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ jobs:
run: ./bin/browsertime.js -b chrome --pageCompleteCheckNetworkIdle --xvfb http://127.0.0.1:3000/simple/
- name: Run test with check network idle in Firefox
run: ./bin/browsertime.js -b firefox --pageCompleteCheckNetworkIdle --xvfb http://127.0.0.1:3000/simple/
- name: Run test with tcp dump
run: ./bin/browsertime.js -b chrome --xvfb http://127.0.0.1:3000/simple/ -n 1 --tcpdump
- name: Run test with scripting.mjs
run: ./bin/browsertime.js -b chrome -n 1 --xvfb test/data/scripting/module.mjs
- name: Run test with scripting.cjs
Expand Down
5 changes: 4 additions & 1 deletion lib/support/tcpdump.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ export class TCPDump {
this.tcpdumpProcess = execa('sudo', parameters);
}
async stop() {
return execa('sudo', ['pkill', '-9', 'tcpdump'], { reject: false });
if (this.tcpdumpProcess) {
await this.tcpdumpProcess.kill('SIGINT');
this.tcpdumpProcess = undefined;
}
}

async mv(url, iteration) {
Expand Down

0 comments on commit 1ce5971

Please sign in to comment.