Skip to content

Commit

Permalink
test: fix test-http2-reset-flood flakiness
Browse files Browse the repository at this point in the history
Refs: #29802 (comment)

PR-URL: #32607
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
addaleax authored and MylesBorins committed Apr 2, 2020
1 parent a83fc49 commit eee587b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/parallel/test-http2-reset-flood.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ const worker = new Worker(__filename).on('message', common.mustCall((port) => {
h2header.writeIntBE(streamId, 5, 4); // Stream ID
streamId += 2;
// 0x88 = :status: 200
conn.write(Buffer.concat([h2header, Buffer.from([0x88])]));
if (conn.writable)
conn.write(Buffer.concat([h2header, Buffer.from([0x88])]));
}
if (!gotError)
if (conn.writable && !gotError)
setImmediate(writeRequests);
}

Expand Down

0 comments on commit eee587b

Please sign in to comment.