summaryrefslogtreecommitdiff
path: root/t/utils.py
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-07-22 21:01:59 -0600
committerbd <bdunahu@operationnull.com>2025-07-22 21:01:59 -0600
commit160b13fd8a46138f31b9458cb46c54af3af95936 (patch)
treedd22b7d6b1a9d3f65e52545b0a58c1ec59a9f5f9 /t/utils.py
parent02ca06b3e835b34b577caf8931abe7c3786a7d87 (diff)
Add a lot more tests, finish yappi comparisons
Diffstat (limited to 't/utils.py')
-rw-r--r--t/utils.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/t/utils.py b/t/utils.py
index 9d77665..4dde466 100644
--- a/t/utils.py
+++ b/t/utils.py
@@ -27,6 +27,8 @@ class AergiaUnitTestCase(unittest.TestCase):
self.assert_roughly_equal(time_actual, time_expected)
def assert_similar_delay(self, func_name, yappi_stats, aergia_samples):
+ '''Compares the results reported by Aergia for FUNC_NAME
+ with yappi.'''
time_yappi = self.yappi_extract_values_by_func(yappi_stats, func_name)
samples_aergia = self.aergia_extract_values_by_func(
@@ -36,10 +38,11 @@ class AergiaUnitTestCase(unittest.TestCase):
self.assert_roughly_equal(time_aergia, time_yappi)
def assert_roughly_equal(self, v1, v2):
- '''Throws an exception if values V1 and V2 are not within 0.03
- seconds of each other.'''
+ '''Throws an exception if values V1 and V2 are not within 0.035
+ seconds of each other. This number is influenced by instrumentation
+ overhead, sampling inconsistency, etc.'''
a = abs(v1 - v2)
- self.assertTrue(a <= .03, f'{v1} (expected) not roughly {v2} (actual)')
+ self.assertTrue(a <= .035, f'{v1} (actual) not roughly {v2} (expected)')
def aergia_expected_time(self, total_samples):
'''Given TOTAL_SAMPLES, returns the total time, using the