File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -1512,17 +1512,23 @@ class MonotonicUUIDsFactory
1512
1512
// / Generate monotone UUIDs
1513
1513
@system unittest
1514
1514
{
1515
+ import core.thread.osthread : Thread ;
1516
+
1515
1517
scope f = new shared MonotonicUUIDsFactory;
1516
1518
1517
1519
UUID [1000 ] uuids;
1518
1520
1519
1521
foreach (ref u; uuids)
1522
+ {
1523
+ // UUIDv7 Method 3 monotonicity is only guaranteed if UUIDs are
1524
+ // generated slower than 2.5 microseconds
1525
+ Thread .sleep(dur! (" hnsecs" )(25 ));
1520
1526
u = f.createUUIDv7_method3;
1527
+ }
1521
1528
1522
1529
foreach (i; 1 .. uuids.length)
1523
1530
{
1524
- // FIXME: disabled for attempt to fix Windows CI
1525
- // ~ assert(uuids[i-1].v7Timestamp_method3 < uuids[i].v7Timestamp_method3);
1531
+ assert (uuids[i- 1 ].v7Timestamp_method3 < uuids[i].v7Timestamp_method3);
1526
1532
assert (uuids[i- 1 ].data[8 .. $] != uuids[i].data[8 .. $], " random parts are not equal" );
1527
1533
}
1528
1534
}
You can’t perform that action at this time.
0 commit comments