test(cmux-next): HomeDock allow_tabs wait: replacement, end when Home's page goes, no polling (#30826 review follow-ups)

LA
5d ago
+70-10

Summary

Review follow-ups to #30826 (Home's dock takes tabs once the tree reports its ids). This PR changes tests and one comment only, with no behavior change.

From the independent review of #30826 (https://github.com/manaflow-ai/cmux/pull/30826#issuecomment-6557423419):

  • Continuation: HomeDockAllowTabsTests no longer loops 2000 Task.yield calls (REVIEW.md section 6). The recorded request resumes a continuation (Sent.next(after:)), and the test also awaits the wait task itself. The suite's time limit bounds a request that never comes.
  • UserDefaults cleanup: each test removes its UserDefaults suite (removePersistentDomain), so no plist is left on the test host.
  • Two new tests:
    • aLaterStepReplacesTheWait: two steps with no ids, then the ids. Exactly one column.update goes, and the first wait ends with none.
    • theWaitEndsWhenHomesPageIsGone: the wait ends when Home's page leaves the tree, and the ids arriving later send nothing.
  • HomeDock:
    • A comment says why the wait keeps the HomeDock across its await. A window Home makes a HomeDock per connect and keeps none, so a later "fix" to a weak capture would break it.
    • allowTabsWait is private(set) so the tests can await it.

Changelog

none

Testing

These are new and changed tests. They cover behavior #30826 already added, so there is no red commit. They pass at the base of this change: the HomeDock behavior is #30826's, unchanged here.

Observed / Not run

  • Observed: the compile-check above and prepush-gate.py with no new violations.
  • Not run: the full CmuxNextHomeEngineTests suite.

perf claim: none


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Review follow-ups to #30826; tests and one comment only, with no behavior change.

  • HomeDockAllowTabsTests no longer loops 2000 Task.yield calls — a recorded request resumes a continuation, and each test awaits the wait task itself.
  • Each test removes its UserDefaults suite, so no plist is left on the test host.
  • Two new tests: a later step replaces the wait (exactly one allow_tabs request when the ids come), and the wait ends when Home's page leaves the tree.
  • HomeDock.allowTabsWait is now private(set) for the tests, and a comment explains why the wait holds the HomeDock across its await.