Repository navigation
Conversation
sidracha
force-pushed
the
srachaba-7-reconcile-tests
branch
2 times, most recently
from
September 8, 2026 18:47
4344c89 to
e87600f
Compare
sidracha
force-pushed
the
srachaba-7-reconcile-tests
branch
from
September 14, 2026 20:50
e87600f to
5cc8a8e
Compare
…on tests Add unit tests in server/src/reconcile_op_heads.rs that directly exercise reconcile_repo_op_heads(). One test verifies the single-head fast path, where reconciliation is a no-op and the existing head is returned without invoking jj-lib. Another test sets up two divergent operation heads in the store and asserts that the server's reconciliation produces exactly the same merged operation as calling jj-lib's resolution directly, confirming parity with jj-lib. A failure-path test registers a divergent head whose underlying operation object is missing from the store, and verifies that reconciliation retries MAX_RETRIES times and then surfaces an error to the caller rather than silently succeeding. Add integration tests in cli/tests/test_concurrent_op_heads.rs that run against a live SQLite-backed server. The first test has two clients race to advance the same op head, and verifies that the stale write is rejected with a CAS conflict. A stress test fires many concurrent UpdateOpHeads RPCs at once and verifies that no writes are lost. Another test confirms that ReconcileOpHeads is a no-op when only a single op head exists for the repo. The final test is end-to-end: it creates divergent op heads in a real workspace, runs a jj CLI command, and confirms that the client automatically triggers server-side reconciliation, collapsing the divergent heads into a single merged operation.
sidracha
force-pushed
the
srachaba-7-reconcile-tests
branch
from
September 14, 2026 20:59
5cc8a8e to
7148b0b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tests: add reconciliation unit tests and concurrent op head integration tests
Add unit tests in server/src/reconcile_op_heads.rs that directly exercise reconcile_repo_op_heads(). One test verifies the single-head fast path, where reconciliation is a no-op and the existing head is returned without invoking jj-lib. Another test sets up two divergent operation heads in the store and asserts that the server's reconciliation produces exactly the same merged operation as calling jj-lib's resolution directly, confirming parity with jj-lib. A failure-path test registers a divergent head whose underlying operation object is missing from the store, and verifies that reconciliation retries MAX_RETRIES times and then surfaces an error to the caller rather than silently succeeding.
Add integration tests in cli/tests/test_concurrent_op_heads.rs that run against a live SQLite-backed server. The first test has two clients race to advance the same op head, and verifies that the stale write is rejected with a CAS conflict. A stress test fires many concurrent UpdateOpHeads RPCs at once and verifies that no writes are lost. Another test confirms that ReconcileOpHeads is a no-op when only a single op head exists for the repo. The final test is end-to-end: it creates divergent op heads in a real workspace, runs a jj CLI command, and confirms that the client automatically triggers server-side reconciliation, collapsing the divergent heads into a single merged operation.