-
Notifications
You must be signed in to change notification settings - Fork 30.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate flaky test-webcrypto-encrypt-decrypt-aes on rhe17-s390x #35586
Comments
Appears to be flaky only on rhe17-390x. Will be investigating refs: nodejs#35586
How frequently is it failing? Just tried on one my my RHEL7 s390x boxes (from master) and it seems to have got through a few hundred iterations without a failure but I'll leave it running a while longer :-) |
Really unclear to be honest. I got through 1000+ iterations without it failing, but then again, I've only seen it fail in full CI runs so it's possible that it only fails when there are other tests running concurrently? |
OK I did get my first failure after probably about 10,000 runs so it definitely is NOT specific to your system (I'm not certain if there might have been other activity at the time, but it is failing every so often). Interesting that it's just the first two digits that seem to be different (unless my eyes have missed another difference - quite possible) and it's always the same mismatch. |
Also checked on an Ubuntu machine (as well as the RHEL7 one while not running anything else) and it has reproduced there to. I've also seen it occurring on line 120 and 159 in the test case as well as 196. Note that on Ubuntu I used a binary compiled on the Ubuntu machine itself so was likely using a slightly different toolchain for the build (although it was still against openssl 1.0.2g so not 1.1)
|
Hello, here is what's causing the issue. I have modified the test as such to make it easier to explain: var global=0; /* added global */
async function testEncrypt({ keyBuffer, algorithm, plaintext, result }, i /* passing global */) {
.
.
.
const output = await subtle.encrypt(algorithm, key, plaintext); console.log(i, "a");
plaintext[0] = 255 - plaintext[0]; console.log(i, "b");
.
.
.
const check = await subtle.decrypt(algorithm, key, output); console.log(i, "c");
output[0] = 255 - output[0]; console.log(i, "d");
assert.strictEqual(
Buffer.from(check).toString('hex'),
Buffer.from(plaintext).toString('hex'));
}
.
.
.
passing.forEach((vector) => {
testEncrypt(vector, global++ /* incrementing global */);
}); Running the test would normally give this output:
But on
I'm not sure why the test case is written as it is, the first async execution of In this case, a single async execution of The actual decryption is heppening here: https://github.com/nodejs/node/blob/master/deps/openssl/config/archs/linux64-s390x/asm/crypto/aes/aes-s390x.S#L817 |
@jasnell ping |
Appears to be flaky only on rhe17-390x. Will be investigating refs: nodejs#35586 PR-URL: nodejs#35587 Refs: nodejs#35586 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Still a thing: https://ci.nodejs.org/job/node-test-commit-linux/nodes=centos7-64-gcc8/39912/console
|
Use Object.assign() to make shallow copies of the object passed to the test functions. The test functions are passed to Promise.all() so execution order is not guaranteed. So using the same object in all of them is a race condition where one test can have side effects in another. Fixes: nodejs#35586
Use Object.assign() to make shallow copies of the object passed to the test functions. The test functions are passed to Promise.all() so execution order is not guaranteed. So using the same object in all of them is a race condition where one test can have side effects in another. Fixes: nodejs#35586
* Use a copy of plaintext to prevent tampering of the original * Since subtle.decrypt returns a Promise containing an ArrayBuffer and ArrayBuffers cannot be modified directly, create a Buffer from it right away so that the modification in the next line works as intended Fixes: nodejs#35586
* Use a copy of plaintext to prevent tampering of the original * Since subtle.decrypt returns a Promise containing an ArrayBuffer and ArrayBuffers cannot be modified directly, create a Buffer from it right away so that the modification in the next line works as intended Fixes: nodejs#35586
* Use a copy of plaintext to prevent tampering of the original * Since subtle.decrypt returns a Promise containing an ArrayBuffer and ArrayBuffers cannot be modified directly, create a Buffer from it right away so that the modification in the next line works as intended Fixes: #35586 PR-URL: #37380 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
The aes encrypt/decrypt webcrypto test appears to be periodically flaky only on rhe17-s390x. Definitely unable to reproduce reliably. Will be investigating.
https://ci.nodejs.org/job/node-test-commit-linuxone/23391/nodes=rhel7-s390x/testReport/junit/(root)/test/parallel_test_webcrypto_encrypt_decrypt_aes/
The text was updated successfully, but these errors were encountered: