Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
fix: preserve each reported timing metric resolution
Richie McIlroy27d697d6b72a
diff --git a/scripts/verify/diff.py b/scripts/verify/diff.pyindex 2e88142c7..095fb6527 100644--- a/scripts/verify/diff.py+++ b/scripts/verify/diff.py@@ -131,10 +131,12 @@ def fresh_fixture(case):def timing_resolution(metric):+ if metric.endswith("-start-late-ms"):+ return 1.0+ if metric in {"secs", "screen-lost-s", "off-periods"} or metric.endswith("-after-start-s"):+ return 0.01if metric.endswith("-ms"):return 0.1- if metric == "secs":- return 0.01if metric.endswith("-s"):return 1e-9return Nonediff --git a/scripts/verify/test_diff.py b/scripts/verify/test_diff.pyindex c5298f0a9..7bca84137 100644--- a/scripts/verify/test_diff.py+++ b/scripts/verify/test_diff.py@@ -53,6 +53,19 @@ class ComparisonTests(unittest.TestCase):def test_timing_metric_outside_recording_cases_uses_distribution(self):self.assertEqual(compare([measured(1, case="playback/basic", metric="warm-up-s")], [measured(2, case="playback/basic", metric="warm-up-s")])[0], "INSUFFICIENT")+ def test_reporter_precision_is_preserved_for_each_timing_unit(self):+ for metric, base, within, beyond in [+ ("screen-start-late-ms", 200, 201, 202),+ ("screen-lost-s", 3.25, 3.26, 3.27),+ ("mic-after-start-s", 0.11, 0.12, 0.13),+ ("off-periods", 1, 1.01, 1.02),+ ]:+ with self.subTest(metric=metric):+ records = [measured(base, case="export/basic", metric=metric) for _ in range(3)]+ self.assertEqual(compare(records[:1], [measured(within, case="export/basic", metric=metric)])[0], "INSUFFICIENT")+ self.assertEqual(compare(records, [measured(within, case="export/basic", metric=metric) for _ in range(3)])[0], "OVERLAP")+ self.assertEqual(compare(records, [measured(beyond, case="export/basic", metric=metric) for _ in range(3)])[0], "WORSE")+def test_fresh_crash_counts_use_frame_resolution(self):base = [measured(176, case="crash/recorder-kill/oop/random0", cls="loss", metric="frames") for _ in range(3)]for value, expected in [(177, "OVERLAP"), (178, "WORSE")]: