• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2const common = require('../common');
3
4common.skipIfInspectorDisabled();
5
6const assert = require('assert');
7const { NodeInstance } = require('../common/inspector-helper.js');
8
9async function testHttp(child, number) {
10  try {
11    await child.httpGet(null, '/json/list');
12    return true;
13  } catch (e) {
14    console.error(`Attempt ${number} failed`, e);
15    return false;
16  }
17}
18
19async function runTest() {
20  const child = new NodeInstance(undefined, '');
21
22  const promises = [];
23  for (let i = 0; i < 100; i++) {
24    promises.push(testHttp(child, i));
25  }
26  const result = await Promise.all(promises);
27  assert(!result.some((a) => !a), 'Some attempts failed');
28  return child.kill();
29}
30
31runTest().then(common.mustCall());
32