From 7627efe1630654b2de12c9cd01e77ec58f0a9198 Mon Sep 17 00:00:00 2001 From: thekevinbot <248217931+thekevinbot@users.noreply.github.com> Date: Sun, 11 Oct 2026 21:26:55 -0400 Subject: [PATCH 1/3] test: the watch case hands paired a Natives, not a bare function --- packages/python/tests/e2e/watch_speed_test.py | 8 ++-- .../hermetic/watch_speed_case_test.py | 39 +++++++++++++++++++ 2 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 packages/python/tests/integration/hermetic/watch_speed_case_test.py diff --git a/packages/python/tests/e2e/watch_speed_test.py b/packages/python/tests/e2e/watch_speed_test.py index d2bf5aefd..caaa16f1e 100644 --- a/packages/python/tests/e2e/watch_speed_test.py +++ b/packages/python/tests/e2e/watch_speed_test.py @@ -147,6 +147,10 @@ def close(self): self.proc.wait(timeout=60) +def measure(native, dirsql): + return paired(native.sample, lambda _timeout: dirsql.sample(), NO_STARTUP, PAIRS) + + def describe_watch_speed_of_light(): @pytest.fixture(scope="module") def trees(tmp_path_factory): @@ -165,9 +169,7 @@ def trees(tmp_path_factory): def it_delivers_a_write_to_the_consumer_within_the_bar(trees): native, dirsql = trees - result = paired( - native.sample, lambda _timeout: dirsql.sample(), NO_STARTUP, PAIRS - ) + result = measure(native, dirsql) assert result.native_rows == next(native.writer.samples) - 1 assert result.dirsql_rows == next(dirsql.writer.samples) - 1 assert_speed_of_light("watch", result, NO_STARTUP) diff --git a/packages/python/tests/integration/hermetic/watch_speed_case_test.py b/packages/python/tests/integration/hermetic/watch_speed_case_test.py new file mode 100644 index 000000000..e19f58ea1 --- /dev/null +++ b/packages/python/tests/integration/hermetic/watch_speed_case_test.py @@ -0,0 +1,39 @@ +"""Hermetic test that the watch case hands the harness a well-formed native.""" + +import os +from itertools import count +from unittest.mock import patch + +import pytest + +from tests.e2e.watch_speed_test import measure + + +class Side: + def __init__(self, seconds): + self.seconds = seconds + self.samples = count(1) + self.last = 0 + + def sample(self): + self.last = next(self.samples) + return self.last, self.seconds + + +@pytest.fixture(params=[False, True], ids=["ratchet", "suite"]) +def mode(request): + env = {"DIRSQL_BENCH_PAIRS": "", "DIRSQL_BENCH_OUT": ""} + if request.param: + env = {"DIRSQL_BENCH_PAIRS": "3", "DIRSQL_BENCH_OUT": "/tmp/unused"} + with patch.dict(os.environ, env): + yield + + +def describe_measure(): + def it_pairs_the_watcher_with_dirsql(mode): + native, dirsql = Side(1.0), Side(1.0) + result = measure(native, dirsql) + assert list(result.native_seconds) == ["inotifywait"] + assert result.native_rows == {"inotifywait": native.last} + assert result.dirsql_rows == dirsql.last + assert result.bar == "inotifywait" From 409ebb5a7e1da55d1516983fcd936cae7fdc952c Mon Sep 17 00:00:00 2001 From: thekevinbot <248217931+thekevinbot@users.noreply.github.com> Date: Sun, 11 Oct 2026 21:38:13 -0400 Subject: [PATCH 2/3] fix: the watch case passes paired a Natives --- packages/python/tests/e2e/watch_speed_test.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/python/tests/e2e/watch_speed_test.py b/packages/python/tests/e2e/watch_speed_test.py index caaa16f1e..a3ebd04a2 100644 --- a/packages/python/tests/e2e/watch_speed_test.py +++ b/packages/python/tests/e2e/watch_speed_test.py @@ -23,6 +23,7 @@ import pytest from .speed_of_light import ( + Natives, Startup, assert_speed_of_light, cli, @@ -148,7 +149,8 @@ def close(self): def measure(native, dirsql): - return paired(native.sample, lambda _timeout: dirsql.sample(), NO_STARTUP, PAIRS) + natives = Natives({"inotifywait": native.sample}, []) + return paired(natives, lambda _timeout: dirsql.sample(), NO_STARTUP, PAIRS) def describe_watch_speed_of_light(): @@ -170,6 +172,6 @@ def trees(tmp_path_factory): def it_delivers_a_write_to_the_consumer_within_the_bar(trees): native, dirsql = trees result = measure(native, dirsql) - assert result.native_rows == next(native.writer.samples) - 1 + assert result.native_rows == {"inotifywait": next(native.writer.samples) - 1} assert result.dirsql_rows == next(dirsql.writer.samples) - 1 assert_speed_of_light("watch", result, NO_STARTUP) From 00b8f71af0d97249208f3ca586dac6ed340b24e7 Mon Sep 17 00:00:00 2001 From: thekevinbot <248217931+thekevinbot@users.noreply.github.com> Date: Sun, 11 Oct 2026 21:38:15 -0400 Subject: [PATCH 3/3] e2e attestation for bot/1503-bench-watch-1011 --- .../python/e2e-attestations/bot-1503-bench-watch-1011.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 packages/python/e2e-attestations/bot-1503-bench-watch-1011.json diff --git a/packages/python/e2e-attestations/bot-1503-bench-watch-1011.json b/packages/python/e2e-attestations/bot-1503-bench-watch-1011.json new file mode 100644 index 000000000..f43c50640 --- /dev/null +++ b/packages/python/e2e-attestations/bot-1503-bench-watch-1011.json @@ -0,0 +1,7 @@ +{ + "command": "uv run python -m tests.e2e.bench_suite --pairs 5 --out /tmp/bench-1503 -k watch", + "ran_at": 1791769095, + "exit_code": 0, + "commit": "409ebb5a7e1da55d1516983fcd936cae7fdc952c", + "branch": "bot/1503-bench-watch-1011" +}