| ... | @@ -271,7 +271,9 @@ test "timestamp" { | ... | @@ -271,7 +271,9 @@ test "timestamp" { |
| 271 | sleep(ns_per_ms); | 271 | sleep(ns_per_ms); |
| 272 | const time_1 = milliTimestamp(); | 272 | const time_1 = milliTimestamp(); |
| 273 | const interval = time_1 - time_0; | 273 | const interval = time_1 - time_0; |
| 274 | testing.expect(interval > 0 and interval < margin); | 274 | testing.expect(interval > 0); |
| | 275 | // Tests should not depend on timings: skip test if outside margin. |
| | 276 | if (!(interval < margin)) return error.SkipZigTest; |
| 275 | } | 277 | } |
| 276 | | 278 | |
| 277 | test "Timer" { | 279 | test "Timer" { |
| ... | @@ -280,7 +282,9 @@ test "Timer" { | ... | @@ -280,7 +282,9 @@ test "Timer" { |
| 280 | var timer = try Timer.start(); | 282 | var timer = try Timer.start(); |
| 281 | sleep(10 * ns_per_ms); | 283 | sleep(10 * ns_per_ms); |
| 282 | const time_0 = timer.read(); | 284 | const time_0 = timer.read(); |
| 283 | testing.expect(time_0 > 0 and time_0 < margin); | 285 | testing.expect(time_0 > 0); |
| | 286 | // Tests should not depend on timings: skip test if outside margin. |
| | 287 | if (!(time_0 < margin)) return error.SkipZigTest; |
| 284 | | 288 | |
| 285 | const time_1 = timer.lap(); | 289 | const time_1 = timer.lap(); |
| 286 | testing.expect(time_1 >= time_0); | 290 | testing.expect(time_1 >= time_0); |