-
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
test: flaky parallel/test-crypto-dh #3881
Comments
It looks like |
Was a change recently made that caused these tests to start timing out? I don't remember seeing these failures until pretty recently |
@evanlucas: 11ad744 on Nov. 10. |
thanks |
Increasing the key size four fold (from 256 to 1024 bytes) as in 11ad744 sure seems like it would explain why the tests might start timing out on Raspberry Pis. Maybe the test can check available memory or CPU or something and select a key size based on that? |
It looks like the CI was not run for #3758 too |
@evanlucas Are you working on trying to figure a fix for this and I should go about my business elsewhere? Or should I keep poking at this? I would be stoked if you were on it because there are plenty of other flaky tests to investigate that aren't this one. But I'm happy to try to figure something out myself if your work here is done. (If you try to use |
I have looked at it a little, but won't be able to get to it for a few hours. Up to you :] |
@Trott Maybe just use the old key sizes on rpi? |
@jasnell I think we can resolve the timeout error if tests are not running in fips mode. Do we change tests? diff --git a/test/parallel/test-crypto-binary-default.js b/test/parallel/test-crypto-binary-default.js
index 8695632..305c110 100644
--- a/test/parallel/test-crypto-binary-default.js
+++ b/test/parallel/test-crypto-binary-default.js
@@ -513,7 +513,8 @@ assert.throws(function() {
// Test Diffie-Hellman with two parties sharing a secret,
// using various encodings as we go along
-var dh1 = crypto.createDiffieHellman(1024);
+var keylen = common.hasFipsCrypto ? 1024 : 256;
+var dh1 = crypto.createDiffieHellman(keylen);
var p1 = dh1.getPrime('buffer');
var dh2 = crypto.createDiffieHellman(p1, 'base64');
var key1 = dh1.generateKeys();
diff --git a/test/parallel/test-crypto-dh.js b/test/parallel/test-crypto-dh.js
index d93c53e..887bc59 100644
--- a/test/parallel/test-crypto-dh.js
+++ b/test/parallel/test-crypto-dh.js
@@ -11,7 +11,8 @@ var crypto = require('crypto');
// Test Diffie-Hellman with two parties sharing a secret,
// using various encodings as we go along
-var dh1 = crypto.createDiffieHellman(1024);
+var keylen = common.hasFipsCrypto ? 1024 : 256;
+var dh1 = crypto.createDiffieHellman(keylen);
var p1 = dh1.getPrime('buffer');
var dh2 = crypto.createDiffieHellman(p1, 'buffer');
var key1 = dh1.generateKeys(); |
@shigeki @Fishrock123 @Trott @jasnell I'll make a PR shortly that restores the old sizes outside of FIPS mode. |
@stefanmb Thanks. |
Landed #3902. |
Generating 1024-bit primes on rpi test machines sometimes causes timeouts. Avoid this situation by using 256-bit primes when not running in FIPS mode. Fixes: #3881 PR-URL: #3902 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Brian White <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
Generating 1024-bit primes on rpi test machines sometimes causes timeouts. Avoid this situation by using 256-bit primes when not running in FIPS mode. Fixes: #3881 PR-URL: #3902 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Brian White <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
I can reproduce this locally up to a point:
The high variance is because the test has to search for suitable prime numbers:
I think we either have to give this test (virtually) unlimited running time or move it to test/pummel.
The text was updated successfully, but these errors were encountered: