Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 31aa33b

Browse filesBrowse files
mildsunrisetargos
authored andcommitted
test: fix race in test-http2-origin
PR-URL: #28903 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent fb57bc4 commit 31aa33b
Copy full SHA for 31aa33b

File tree

Expand file treeCollapse file tree

1 file changed

+9
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-5
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-http2-origin.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http2-origin.js
+9-5Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ const ca = readKey('fake-startcom-root-cert.pem', 'binary');
8888
['https://example.org', 'https://example.com']
8989
];
9090

91-
const countdown = new Countdown(2, () => {
91+
const countdown = new Countdown(3, () => {
9292
client.close();
9393
server.close();
9494
});
@@ -101,7 +101,7 @@ const ca = readKey('fake-startcom-root-cert.pem', 'binary');
101101
countdown.dec();
102102
}, 2));
103103

104-
client.request().on('close', mustCall()).resume();
104+
client.request().on('close', mustCall(() => countdown.dec())).resume();
105105
}));
106106
}
107107

@@ -119,15 +119,19 @@ const ca = readKey('fake-startcom-root-cert.pem', 'binary');
119119
const originSet = [`https://localhost:${server.address().port}`];
120120
const client = connect(originSet[0], { ca });
121121

122+
const countdown = new Countdown(2, () => {
123+
client.close();
124+
server.close();
125+
});
126+
122127
client.on('origin', mustCall((origins) => {
123128
originSet.push(...check);
124129
deepStrictEqual(client.originSet, originSet);
125130
deepStrictEqual(origins, check);
126-
client.close();
127-
server.close();
131+
countdown.dec();
128132
}));
129133

130-
client.request().on('close', mustCall()).resume();
134+
client.request().on('close', mustCall(() => countdown.dec())).resume();
131135
}));
132136
}
133137

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.