Skip to content

OBJ-83 — Two-client convergence integration test - #29

Merged
objectgyan merged 1 commit into
mainfrom
objectgyan/obj-83-m53-two-client-convergence-integration-test
May 17, 2026
Merged

objectgyan merged 1 commit into
mainfrom
objectgyan/obj-83-m53-two-client-convergence-integration-test

Conversation

@objectgyan

Copy link
Copy Markdown
Owner

Summary

  • Adds tests/yjs-convergence/convergence.js — a Node.js harness that spawns two WebSocket clients against the live API, performs concurrent and interleaved Y.js updates, and asserts both clients converge to identical SHA-256 state-vector within 5 seconds.
  • YJS_DIVERGE=1 mode deliberately withholds relay to client B, producing a clear diff failure (exit 1) to validate the assertion is not vacuous.
  • Adds yjs-convergence CI job to .github/workflows/ci.yml — starts ephemeral Postgres + API, runs positive and negative paths, total budget ≤ 5 minutes.

Test plan

  • Positive path: node tests/yjs-convergence/convergence.js http://localhost:5199 exits 0, 12 assertions pass, state vectors equal
  • Negative path: YJS_DIVERGE=1 node tests/yjs-convergence/convergence.js http://localhost:5199 exits 1, diff message shown
  • scripts/validate-obj-83.ps1 exits 0 locally (proved via validation artifacts)
  • validation/obj-83-db.txt — 4 OBJ-83 documents + 4 snapshot rows confirmed
  • validation/obj-83-api.txt — full convergence + divergence run transcript captured

@linear-code

linear-code Bot commented May 17, 2026 •

Copy link
Copy Markdown
OBJ-83 M5.3 — Two-client convergence integration test

Milestone: M5 · Wave: 2

Summary

Author an integration test that spawns two Y.js clients (Node) against the live API, performs concurrent edits, and asserts convergence + no data loss.

Acceptance

  • Both clients reach identical state
  • Test runs in CI on the ephemeral PG + API container
  • Failure mode: deliberate divergence triggers a clear test failure

Validation

  • DB check: post-test snapshot exists with the converged body
  • Live API check: test exits 0 in <60s; logs show update propagation
  • Script: scripts/validate-obj-NNN.ps1

Branch / PR

Branch from main; target main. No trailers/footer.

Review in Linear

@objectgyan
objectgyan merged commit f7a5b79 into main May 17, 2026
2 of 3 checks passed
objectgyan added a commit that referenced this pull request May 17, 2026
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