Open MoLow opened 1 year ago
I took https://ci.nodejs.org/computer/test-osuosl-aix72-ppc64_be-2/ offline to investigate
on AIX tools/test.py sequential/test-http2-large-file --timeout 30 --repeat 50
reproduces easily
however, this change causes the test to be very stable and I have no idea why:
diff --git a/test/sequential/test-http2-large-file.js b/test/sequential/test-http2-large-file.js
index 2f2cc2c80d..3afcec73f4 100644
--- a/test/sequential/test-http2-large-file.js
+++ b/test/sequential/test-http2-large-file.js
@@ -24,6 +24,7 @@ server.listen(0, common.mustCall(() => {
{ settings: { initialWindowSize: 6553500 } });
const request = client.request({ ':method': 'POST' });
function writeChunk() {
+ console.log({ remaining });
if (remaining > 0) {
remaining -= chunkLength;
request.write(chunk, writeChunk);
on AIX
tools/test.py sequential/test-http2-large-file --timeout 30 --repeat 50
reproduces easily however, this change causes the test to be very stable and I have no idea why:diff --git a/test/sequential/test-http2-large-file.js b/test/sequential/test-http2-large-file.js index 2f2cc2c80d..3afcec73f4 100644 --- a/test/sequential/test-http2-large-file.js +++ b/test/sequential/test-http2-large-file.js @@ -24,6 +24,7 @@ server.listen(0, common.mustCall(() => { { settings: { initialWindowSize: 6553500 } }); const request = client.request({ ':method': 'POST' }); function writeChunk() { + console.log({ remaining }); if (remaining > 0) { remaining -= chunkLength; request.write(chunk, writeChunk);
There's a long history of console.log()
statements causing tests to succeed that otherwise fail because they are blocking or otherwise causes an I/O delay that "fixes" a race condition. I can probably find an issue from 2015 about this!
it does not seem to be a race condition, this did not fix the issue:
diff --git a/test/sequential/test-http2-large-file.js b/test/sequential/test-http2-large-file.js
index 2f2cc2c80d..300e0642ab 100644
--- a/test/sequential/test-http2-large-file.js
+++ b/test/sequential/test-http2-large-file.js
@@ -24,12 +24,14 @@ server.listen(0, common.mustCall(() => {
{ settings: { initialWindowSize: 6553500 } });
const request = client.request({ ':method': 'POST' });
function writeChunk() {
- if (remaining > 0) {
+ setTimeout(() => {
+ if (remaining > 0) {
remaining -= chunkLength;
request.write(chunk, writeChunk);
} else {
request.end();
}
+ }, 10);
I forget (or maybe never knew!) the details, but console.log()
has weird side effects that cause I/O flushing or other things and the side effects vary from platform to platform. Maybe someone on @nodejs/console or @nodejs/libuv would know more. If I recall correctly, it blocks on some platforms but not on others.
process.stdout.write('');
does not make the issue go await either so it is definitely very specific to console.log
@miladfarca has been investigating this as an upstream V8 issue: https://bugs.chromium.org/p/v8/issues/detail?id=13902
https://ci.nodejs.org/computer/test-osuosl-aix72-ppc64_be-2/ is back online
Happened on Windows and Linux with https://ci.nodejs.org/job/node-test-pull-request/56726/
The V8 issue talks about disabling concurrent sparkplug to fix it temporarily but we already do it: https://github.com/nodejs/node/commit/7071c1dafd70dfaa8f219da8f53153b63047d1cc
Related:
main
) and unskipping problematic tests: https://github.com/nodejs/node/pull/47461This really happens a lot lately. I opened https://github.com/nodejs/node/pull/51549
From https://github.com/nodejs/reliability/issues/772:
The first time it occurred in this build https://ci.nodejs.org/job/node-daily-master/3286/, so i guess something that landed around 7th of Jan might've caused this. From what I can see the difference is this commit https://github.com/nodejs/node/commit/1a5acd0638579e687dde128cc6d4effe3ab070d1
Test
test-http2-large-file
Platform
AIX
Console output
Build links
Additional information
No response