Skip to content

tests: skip the signer's fsync in the e20 model arm test (#722) - #806

Merged
LoopGlitch26 merged 2 commits into
Cygnux-Labs:mainfrom
khushi-git-7:agent/issue-722-e20
Nov 13, 2026
Merged

LoopGlitch26 merged 2 commits into
Cygnux-Labs:mainfrom
khushi-git-7:agent/issue-722-e20

Conversation

@khushi-git-7

Copy link
Copy Markdown
Contributor

Part (3) of #722, step (1): the tests side, as agreed there. Built on #803, whose commit is the first one here until it lands; this PR's own change is dc7f2a1.

Why

ModelArm::test_e20_model_arm_scores_both_sets_with_a_fake_model records every scored session in e20's in-process signer. Its syncs run on the signer's thread, and on windows-latest they were about half the test's time. In the measurements on #722, stubbing fsync took the test from 172 s to 71 s there.

Change

  • signer_without_fsync and SIGNER_SYNCS move from tests/test_bounded.py to tests/factories.py. The code is unchanged; the docstring now describes any test of what a signer decides and records, not just the state space. test_bounded.py imports them.
  • The e20 test holds signer_without_fsync() around e20.model_main(...), and asserts that no sync was made outside the signer's modules. That's the same guard as tests: skip the signer's fsync in the approval state space's workers (#722) #803.

Checked on my fork

Both changed tests, with the change:

e20 model arm ApprovalStateSpace (both tests)
windows-latest 3.13 123 s 84 s
ubuntu-latest 3.13 29 s 60 s
ubuntu-22.04 3.9 20 s 49 s

On main, the e20 test took 172 s and 232 s on windows-latest in two runs, and 38-40 s on ubuntu-latest. Windows runners vary a lot between runs. The rest of the Windows gap is the SSL context per model call, which is step (2), a separate PR in client.py.

The guard, checked with every sync counted as made outside the signer: all three tests fail on all three jobs with ['tracekit.deploy.files', 'tracekit.signer.service', 'tracekit.storage.file'] != []. pyflakes is clean on the three files.

…ygnux-Labs#722)

fsync was most of ApprovalStateSpace's time on windows-latest: 689 s as on
main, 50 s with fsync skipped in the workers (52 s and 36 s on ubuntu-latest),
with the same sequences and outcomes. The class checks the approval state
machine; durability has its own tests, which the comment names.

Each part skips the syncs of the signer's modules (its logs, its new files, and
its state and key files) for its own run only, a patch held while the part runs
in its worker process. A sync from any other module still runs and is counted,
and the test expects none, so a sync the signer moves elsewhere fails it instead
of making it slow again.

Signed-off-by: Khushi Jain <jainkhushibts@gmail.com>
…#722)

test_e20_model_arm_scores_both_sets_with_a_fake_model records every scored
session in e20's in-process signer, and its syncs were most of the test's
time on windows-latest. signer_without_fsync moves from test_bounded.py to
tests/factories.py, unchanged but for its docstring, and the test holds it
around model_main, with the same guard: a sync from outside the signer's
modules still runs and fails the test.

Signed-off-by: Khushi Jain <jainkhushibts@gmail.com>
@LoopGlitch26

Copy link
Copy Markdown
Member

Read it:

It goes on the merge list once CI is green.

@LoopGlitch26
LoopGlitch26 enabled auto-merge (squash) November 13, 2026 10:58
@LoopGlitch26
LoopGlitch26 merged commit 27a7a30 into Cygnux-Labs:main Nov 13, 2026
32 of 34 checks passed
@LoopGlitch26

Copy link
Copy Markdown
Member

Merged, thank you. Skipping the signer's fsync in that test takes away the slow part you measured on the low-memory machine, and the test still checks the same thing. #807 is next in line; it merges by itself once CI is green.

LoopGlitch26 added a commit that referenced this pull request Nov 13, 2026
#803 defined it in test_bounded.py and #806 moved it to factories and imported it; merged together, test_bounded.py
kept both and pyflakes failed (redefinition of unused 'signer_without_fsync'). The bodies were the same.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>
LoopGlitch26 added a commit that referenced this pull request Nov 13, 2026
…ne signer_without_fsync (lint) (#820)

* tracekit audit: a gptme call its hook can't read is blocked, not an error

gptme's checks of a call's shape raised a plain ValueError. Its hook blocks such a call, but since #779 audit
counts only UnreadableCall as blocked and ends the replay on any other ValueError, so main's audit test failed
for gptme (test_the_guard_line_names_the_calls_files_agent). The two PRs each passed CI before the other merged.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* tracekit audit: a gptme MCP call whose content isn't JSON is blocked, not an error

The same mismatch as the shape checks: json.loads raised a plain ValueError, which gptme's hook blocks and audit
ended the replay on. Found by the independent review of this PR.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

* tests: one signer_without_fsync, from factories (main's lint)

#803 defined it in test_bounded.py and #806 moved it to factories and imported it; merged together, test_bounded.py
kept both and pyflakes failed (redefinition of unused 'signer_without_fsync'). The bodies were the same.

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>

---------

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants