Skip to content
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: add (temporary) logging for unreliable test #26216

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: add (temporary) logging for unreliable test
Refs: #25984
  • Loading branch information
Trott committed Feb 20, 2019
commit e76d10fdbc3df95f5bee0903aba4ed0516798ac6
4 changes: 4 additions & 0 deletions test/pummel/test-crypto-timing-safe-equal-benchmarks.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ function runOneBenchmark(...args) {
}

function getTValue(compareFunc) {
console.log(compareFunc.name);
const numTrials = 1e5;
const bufSize = 10000;
// Perform benchmarks to verify that timingSafeEqual is actually timing-safe.
Expand All @@ -32,6 +33,9 @@ function getTValue(compareFunc) {
const rawUnequalBenches = Array(numTrials);

for (let i = 0; i < numTrials; i++) {
if (i % 1000 === 0) {
console.log(i);
}
if (Math.random() < 0.5) {
// First benchmark: comparing two equal buffers
rawEqualBenches[i] = runOneBenchmark(compareFunc, 'A', 'A', bufSize);
Expand Down