Add Linux build support and fix test argv handling
- BUILD-GUIDE.md: Add full Linux build instructions alongside Windows (system deps, depot_tools setup, gn/ninja paths for both platforms) - README.md: Update downloads section and usage examples for Linux - test/cdp-test.js: Fix argv parsing to handle --no-sandbox and other Electron flags that shift argument positions Verified with successful Linux x64 build (Electron v43.0.0-nightly) and automated stress test: p99 20ms, 0% messages >50ms. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
+5
-2
@@ -4,8 +4,11 @@ const fs = require('fs');
|
||||
const path = require('path');
|
||||
const { WebSocketServer } = require('ws');
|
||||
|
||||
const PORT = parseInt(process.argv[2] || '8085');
|
||||
const LABEL = process.argv[3] || 'TEST';
|
||||
// Filter out Electron/Chromium flags (e.g. --no-sandbox) from argv to find app args
|
||||
const appArgs = process.argv.slice(1).filter(a => !a.startsWith('-'));
|
||||
// appArgs[0] is the script path, rest are user arguments
|
||||
const PORT = parseInt(appArgs[1] || '8085');
|
||||
const LABEL = appArgs[2] || 'TEST';
|
||||
const TEST_DURATION_MS = 12000;
|
||||
const WARMUP_MS = 3000;
|
||||
|
||||
|
||||
Generated
+36
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"name": "ws-starvation-test",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "ws-starvation-test",
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"ws": "^8.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/ws": {
|
||||
"version": "8.20.0",
|
||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.20.0.tgz",
|
||||
"integrity": "sha512-sAt8BhgNbzCtgGbt2OxmpuryO63ZoDk/sqaB/znQm94T4fCEsy/yV+7CdC1kJhOU9lboAEU7R3kquuycDoibVA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"bufferutil": "^4.0.1",
|
||||
"utf-8-validate": ">=5.0.2"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"bufferutil": {
|
||||
"optional": true
|
||||
},
|
||||
"utf-8-validate": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user