Skip to content

Commit 19bb93c

Browse files
committed
crypto: fix flaky test
1 parent 5e312c1 commit 19bb93c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/parallel/test-crypto-randomuuidv7.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ const {
5656
const timestamp = parseInt(timestampHex, 16);
5757

5858
assert(timestamp >= before, `Timestamp ${timestamp} < before ${before}`);
59-
assert(timestamp <= after, `Timestamp ${timestamp} > after ${after}`);
59+
// The monotonic counter may have overflowed in a prior call and advanced
60+
// v7LastTimestamp by 1 ms beyond wall-clock time (RFC 9562 §6.2 allows this).
61+
assert(timestamp <= after + 1, `Timestamp ${timestamp} > after+1 ${after + 1}`);
6062
}
6163

6264
{

0 commit comments

Comments
 (0)