Skip to content

test(model): wait for the hydration count before the report in the live plan - #169

Merged
aicayzer merged 1 commit into
mainfrom
test/live-reliability
Oct 26, 2026
Merged

aicayzer merged 1 commit into
mainfrom
test/live-reliability

Conversation

@aicayzer

Copy link
Copy Markdown
Contributor

Summary

The Live test plan sometimes timed out when run as a whole against a test instance. One test, makesEditsLinksAndUndoesItsOwnItems, raced with the copy's own rehydration: it checked that the copy was whole before checking that a new hydration had been counted, but the copy marks itself as catching up before it counts one. The check could pass on the old, whole report while the hydration had already begun, and the next undo was then refused during the catch-up. This change reads the count first and then the source's own report, so the wait only ends once the rehydration has finished.

Changes

  • MarfaLibraryLiveTests.swift: rehydrated(after:) waits for the hydration count to rise, then reads the source's sync report (the library's report follows it a moment later).
  • MarfaHostLiveTests.swift: the waiting == 2 expectation in the purged-elsewhere test now reports the waiting count, connection state and problems if it fails, so a recurrence shows its state.

Testing

Against the demo test instance, the whole Live plan, three times:

  • Two runs on the unfixed code each failed three tests, including makesEditsLinksAndUndoesItsOwnItems after about 127 s. A diagnostic showed the hub and library phase were both catchingUp when the undo was issued. The server was idle during the wait (median request time 5 ms, slowest 1.3 s), so the cause is the test, not the server.
  • The run on this change passed makesEditsLinksAndUndoesItsOwnItems and took about 295 s instead of about 400 s. One test still failed: theNameIsReadChangedAndPutBack, which returns notPermitted in under a second because the test instance's key for this app lacks config.manage (the server log shows GET /config 403). That is a test instance setting and not changed here.
  • The Host suite was rerun alone after the message change and passed.

Not tested: the stall seen once in editsToAnItemPurgedElsewhere… right after the demo instance restarted. It did not recur in more than 20 later passes, so the cause is unknown and this change does not claim to fix it; the added message is for the next occurrence. No UI test plan or app launch was run.

Notes for reviewers

Tests only, so checks are enough and no code review is needed. Pull requests 98 and 127 also touch MarfaLibraryLiveTests.swift; the edit here is a few lines in one helper.

Checklist

  • The title is a scoped Conventional Commit.
  • New behavior has a test that was seen failing first, or no test was needed and the reason is above.
  • Docs, comments and the contract still say what is true after this change.

@aicayzer aicayzer left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: checks only

@aicayzer
aicayzer marked this pull request as ready for review October 26, 2026 15:35
@aicayzer
aicayzer merged commit 235d786 into main Oct 26, 2026
4 checks passed
@aicayzer
aicayzer deleted the test/live-reliability branch October 26, 2026 15:59
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.

1 participant