Deflake the collab restore-listener DB test (poll for the PRE_RESTORE row)
All checks were successful
CD / Build and push images (push) Successful in 1m49s
CD / Deploy to Test (push) Successful in 9s
CD / Smoke tests against Test (push) Successful in 1m10s
CD / Promote to Int (push) Successful in 10s
CI / Lint, typecheck, test (push) Successful in 3m52s
CI / Build container images (push) Has been skipped
CI / Auth e2e pack (push) Successful in 5m32s
CI / Import/export fidelity gate (push) Successful in 47s
All checks were successful
CD / Build and push images (push) Successful in 1m49s
CD / Deploy to Test (push) Successful in 9s
CD / Smoke tests against Test (push) Successful in 1m10s
CD / Promote to Int (push) Successful in 10s
CI / Lint, typecheck, test (push) Successful in 3m52s
CI / Build container images (push) Has been skipped
CI / Auth e2e pack (push) Successful in 5m32s
CI / Import/export fidelity gate (push) Successful in 47s
The client converges on the restored content via the broadcast INSIDE the document transact — before the listener commits the PRE_RESTORE version row. Asserting the row immediately after convergence is a race that CI lost on the #104 run; poll for it instead. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EwZ4jR4KFAPvpjWevfUGX1
This commit is contained in:
parent
0c85293830
commit
52975bad0a
@ -141,12 +141,21 @@ describe.skipIf(!url)('restore listener (DB-backed, issue #42)', () => {
|
||||
expect(textOf(doc)).not.toContain('current text');
|
||||
|
||||
// A pre-restore snapshot was appended; history is append-only (the original
|
||||
// manual version is still present too).
|
||||
// manual version is still present too). Poll: the broadcast the client
|
||||
// converged on happens inside the transact, BEFORE the listener commits
|
||||
// the PRE_RESTORE row — asserting immediately is a race.
|
||||
const triggersNow = async (): Promise<string[]> => {
|
||||
const versions = await pool.query<{ trigger: string }>(
|
||||
'SELECT trigger FROM page_versions WHERE page_id = $1',
|
||||
[pageId],
|
||||
);
|
||||
const triggers = versions.rows.map((r) => r.trigger);
|
||||
return versions.rows.map((r) => r.trigger);
|
||||
};
|
||||
let triggers: string[] = [];
|
||||
await waitFor(() => {
|
||||
void triggersNow().then((rows) => (triggers = rows));
|
||||
return triggers.includes('PRE_RESTORE');
|
||||
});
|
||||
expect(triggers).toContain('PRE_RESTORE');
|
||||
expect(triggers).toContain('MANUAL');
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user