Skip to content

Commit 4bf1433

Browse files
XuananLeLe Xuan An
authored andcommitted
test: Stabilize feature server performance check
Signed-off-by: Le Xuan An <[email protected]>
1 parent 6ba7a53 commit 4bf1433

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎sdk/python/tests/unit/test_feature_server_utils.py‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
import base64
2525
import json
26+
import platform
2627
import time
2728

2829
import pytest
@@ -655,7 +656,12 @@ def test_faster_than_message_to_dict(self):
655656
print(f"\nPerformance: fast={fast_time:.3f}s, standard={standard_time:.3f}s")
656657
print(f"Speedup: {speedup:.2f}x")
657658

658-
assert speedup >= 1.5, f"Expected at least 1.5x speedup, got {speedup:.2f}x"
659+
# GitHub-hosted macOS runners show more timing variance on this
660+
# microbenchmark while still validating a meaningful speedup.
661+
min_speedup = 1.3 if platform.system() == "Darwin" else 1.5
662+
assert speedup >= min_speedup, (
663+
f"Expected at least {min_speedup:.1f}x speedup, got {speedup:.2f}x"
664+
)
659665

660666

661667
class TestStatusNames:

0 commit comments

Comments
 (0)