We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4985cb4 commit 28c3979Copy full SHA for 28c3979
test/layer4/fast_path_optimization_test.exs
@@ -279,9 +279,11 @@ defmodule JsonRemedy.Layer4.FastPathOptimizationTest do
279
# Verify roughly linear scaling (later times shouldn't be exponentially larger)
280
[time1, time2, time3] = times
281
282
- # Time should scale roughly linearly (allowing for some variance)
283
- ratio_1_to_2 = time2 / max(time1, 1)
284
- ratio_2_to_3 = time3 / max(time2, 1)
+ # Add a baseline to smooth out high-resolution timer noise on fast paths (e.g. Windows CI)
+ baseline = 5_000
+
285
+ ratio_1_to_2 = (time2 + baseline) / (time1 + baseline)
286
+ ratio_2_to_3 = (time3 + baseline) / (time2 + baseline)
287
288
# Ratios should be reasonable (not exponential growth)
289
assert ratio_1_to_2 < 10
0 commit comments