-
Notifications
You must be signed in to change notification settings - Fork 15k
/
fix_account_for_debugger_agent_race_condition.patch
35 lines (32 loc) · 1.66 KB
/
fix_account_for_debugger_agent_race_condition.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Thu, 10 Jun 2021 15:15:35 +0200
Subject: fix: account for debugger agent race condition
In Electron the debugger agent hasn't necessarily been enabled by the
time the inspect prompt displays, leading to "Debugger agent is not enabled"
errors. This is remedied by adding a small timeout to the test.
We'll either upstream this or figure out a better solution.
diff --git a/test/parallel/test-debugger-address.mjs b/test/parallel/test-debugger-address.mjs
index eab99c9b0e2fb387ef9a716396e41c7fc93e93bc..f33e85415e3a8d5df073acbf03aed5271e88a1a7 100644
--- a/test/parallel/test-debugger-address.mjs
+++ b/test/parallel/test-debugger-address.mjs
@@ -56,6 +56,7 @@ function launchTarget(...args) {
const { childProc, host, port } = await launchTarget('--inspect=0', script);
target = childProc;
cli = startCLI([`${host || '127.0.0.1'}:${port}`]);
+ await new Promise(resolve => setTimeout(resolve, 1000))
await cli.waitForPrompt();
await cli.command('sb("alive.js", 3)');
await cli.waitFor(/break/);
diff --git a/test/sequential/test-debugger-pid.js b/test/sequential/test-debugger-pid.js
index 99062149dfe3374b86439850e0655383e2bad662..97c93741b2426740e12eaf9e7786ae6ded4782b7 100644
--- a/test/sequential/test-debugger-pid.js
+++ b/test/sequential/test-debugger-pid.js
@@ -20,6 +20,7 @@ const runTest = async () => {
await cli.command('sb("alive.js", 3)');
await cli.waitFor(/break/);
await cli.waitForPrompt();
+ await new Promise(resolve => setTimeout(resolve, 1000))
assert.match(
cli.output,
/> 3 {3}\+\+x;/,