GPU benchmark server test: listen on 127.0.0.1, where it connects
On the CI runners localhost resolves to ::1 first, so the server listened there while the test connected to 127.0.0.1.
This commit is contained in:
parent
aef744af50
commit
02d3709944
1 changed files with 1 additions and 1 deletions
|
|
@ -21,7 +21,7 @@ function req(port, { method = 'GET', p = '/', host, headers = {}, body } = {}) {
|
|||
|
||||
test('the benchmark server answers only its own page', async (t) => {
|
||||
const port = 20000 + Math.floor(Math.random() * 20000), out = path.join(fs.mkdtempSync(path.join(os.tmpdir(), 'bench-')), 'out.md');
|
||||
const srv = spawn(process.execPath, [path.join(ROOT, 'scripts', 'gpu-bench.js'), '--port', String(port), '--out', out], { stdio: ['ignore', 'pipe', 'pipe'] });
|
||||
const srv = spawn(process.execPath, [path.join(ROOT, 'scripts', 'gpu-bench.js'), '--port', String(port), '--host', '127.0.0.1', '--out', out], { stdio: ['ignore', 'pipe', 'pipe'] });
|
||||
let log = ''; srv.stdout.on('data', (c) => { log += c; }); srv.stderr.on('data', (c) => { log += c; });
|
||||
t.after(() => srv.kill());
|
||||
for (let i = 0; i < 100 && !/Ctrl\+C/.test(log); i++) await new Promise((r) => setTimeout(r, 100));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue