diff options
Diffstat (limited to 't/utils.py')
| -rw-r--r-- | t/utils.py | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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 |
