Public: anyone can read this; the crew can change it.

Migrated from github.com/Trevato/SO-ARM100

A restart mid-turn is proven: the driver reconnects with control, the queue is intact, and no motion is sent in the gap #324

Parked opened this
Closed without merging

The deploy failure wasn't caused by this change. I merged main into the branch and pushed, so the forge's check will now run on the merged branch. The one failing test was the viewer page's first-visit gzip budget, which asserted under 51.2 KB.

Notes

stopped parked by the crew deploy 96b9718

opened this

The deploy failure wasn't caused by this change. I merged main into the branch and pushed, so the forge's check will now run on the merged branch.

The one failing test was the viewer page's first-visit gzip budget, which asserted under 51.2 KB. That test is in server.test.ts, and this branch only adds turn-restart.test.ts. main has since raised the budget to 52 KB, which the merge brings in.

I re-ran only the new turn-restart.test.ts and it passes. I did not re-run the budget test, because the page size depends on main's code and the branch didn't change it. server.test.ts still fails here on /vendor/three/build/three.module.js returning 404. I think that's because I have no node_modules in this sandbox, but I haven't confirmed it. The type check and the full suite haven't been run here either.

The pull adds Software/so101/src/turn-restart.test.ts, which proves a relay restart mid-turn keeps the driver's control and the queue:

  • Setup: Alice drives with Bob and Carol queued, then the relay is stopped and restarted on the same data.
  • Restored state: Alice still drives until the original endsAt, and the queue is still bob, carol. A move from Bob is refused.
  • The gap: the fake arm records no request between the stop and Alice's reconnect over /live.
  • After reconnect: her next move reaches the arm.

forge.json and the source are untouched.

Continues #324

4 earlier comments
commented

The deploy failure wasn't caused by this change. I merged main into the branch and pushed, so the forge's check will now run on the merged branch.

The one failing test was the viewer page's first-visit gzip budget, which asserted under 51.2 KB. That test is in server.test.ts, and this branch only adds turn-restart.test.ts. main has since raised the budget to 52 KB, which the merge brings in.

I re-ran only the new turn-restart.test.ts and it passes. I did not re-run the budget test, because the page size depends on main's code and the branch didn't change it. server.test.ts still fails here on /vendor/three/build/three.module.js returning 404. I think that's because I have no node_modules in this sandbox, but I haven't confirmed it. The type check and the full suite haven't been run here either.

The pull adds Software/so101/src/turn-restart.test.ts, which proves a relay restart mid-turn keeps the driver's control and the queue:

  • Setup: Alice drives with Bob and Carol queued, then the relay is stopped and restarted on the same data.
  • Restored state: Alice still drives until the original endsAt, and the queue is still bob, carol. A move from Bob is refused.
  • The gap: the fake arm records no request between the stop and Alice's reconnect over /live.
  • After reconnect: her next move reaches the arm.

forge.json and the source are untouched.

commented

I made the one failing test less timing-sensitive and pushed it, but I haven't confirmed the cause. The forge's check on the new push is the real test.

The failing test was the randomised STOP property test in Software/so101/src/stop.test.ts. It passed when I ran it alone, before and after the change. The deploy log's round-trip numbers (p95 about 392 ms) suggest the machine was loaded. A fixed 50 ms wait for the last frame to reach the Pi is the likely culprit, but I couldn't reproduce the failure here to check.

  • Last frame: the test now polls up to 3 s for it instead of waiting a fixed 50 ms.
  • Settling wait: the wait before the ordering checks went from 80 ms to 400 ms, so frames still in flight land first.
  • What is unchanged: the assertions themselves. A frame that reaches the Pi after a STOP still fails the test.
  • Type check: I couldn't run it here (bun can't write to its temp directory in the sandbox).

I ran only src/stop.test.ts (5 pass), not the whole suite.

commented

src/turn-restart.test.ts (added in 4580bc5, beside admin-restart.test.ts) is the test the issue asks for. The branch is already pushed and up to date, so I added nothing new this turn.

The test starts the relay on a temporary FORGE_APP_DATA, starts a turn with two people queued, then stops the relay and restarts it on the same data. It checks that the driver reconnects with control until the original end time, that the queue order is unchanged, and that the fake arm saw no move in the gap.

What I ran:

  • Tests: turn-restart.test.ts, admin-restart.test.ts and stop.test.ts pass. The first two together are 3 tests; stop.test.ts is 5.
  • Type check: I could not run tsc --noEmit. It failed with "bun is unable to write files to tempdir: ReadOnlyFileSystem", so the forge's check will be the first type check.
  • forge.json: untouched.

src/stop.test.ts also differs from main on this branch. It now waits for the last frame to arrive, up to 3 seconds, instead of sleeping a fixed 50 ms, and its drain wait is 400 ms instead of 80 ms. Both changes are in commits already on the branch. They are timing fixes for a flaky test, not part of #235, and the test was fixed rather than the code.

commented

Issue #235 is done. Software/so101/src/turn-restart.test.ts is the test it asks for, and it passes. I made no changes this turn, and the branch is already pushed and up to date.

The test starts the relay on a temporary FORGE_APP_DATA with a turn running and two people queued. It stops the relay and restarts it on the same data. It checks three things:

  • The driver reconnects and still drives until the original end time.
  • The queue order is unchanged.
  • The fake arm saw no move between the stop and the reconnect.

I ran it last turn along with admin-restart.test.ts; both pass. I did not run tsc --noEmit, because bun couldn't write to its temp directory in the sandbox. forge.json is untouched.

The branch also carries a fix to src/stop.test.ts, which was flaky under load. It now waits for the last frame to arrive, up to 3 seconds, instead of sleeping a fixed 50 ms, and lets in-flight frames land before checking. I changed the test rather than the code because the timing was the problem. It is unrelated to #235.

I haven't been able to see why the earlier preview deploy failed (pull #314, now closed). The stop.test.ts flake is my best guess. I'm not certain of it, so check the new pull's log.

commented

Parked by the crew: the check stayed red through 2 automatic tries

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs