Compare commits

...
Author SHA1 Message Date
beardthelion 6143c2ebb0 test(node): derive the first-OID expectation from every reachable object
sweep_persists_last_attempted_not_planned_tail_on_mid_batch_narrow sorted only
HEAD's commit, tree and three blobs to find the first object the sweep
dispatches. The fixture makes three commits, so the two earlier commits and
trees are reachable too, and an earlier commit id changes with its timestamp.
When one sorted below the other five the expected first OID was wrong and the
test failed.

Take the expectation from git rev-list --objects --all (nine objects). On an
unpatched main build the test failed 3 of 45 serial runs; with this change it
failed 0 of 45.
2026-11-13 09:51:03 -06:00
+11 -3
View File
@@ -4343,10 +4343,18 @@ mod tests {
let blob_a = repo_on_disk.git(&["rev-parse", "HEAD:a.txt"]);
let blob_b = repo_on_disk.git(&["rev-parse", "HEAD:b.txt"]);
let blob_c = repo_on_disk.git(&["rev-parse", "HEAD:c.txt"]);
let commit = repo_on_disk.git(&["rev-parse", "HEAD"]);
let tree = repo_on_disk.git(&["rev-parse", "HEAD^{tree}"]);
let mut all = [blob_a.clone(), blob_b.clone(), blob_c.clone(), commit, tree];
// Every object the sweep can plan, not just HEAD's: the three commits
// and three trees are all reachable, and an earlier commit's id changes
// with the commit timestamp. Sorting only HEAD's commit, tree and blobs
// picked the wrong "first" whenever an earlier commit sorted below them.
let mut all: Vec<String> = repo_on_disk
.git(&["rev-list", "--objects", "--all"])
.lines()
.filter_map(|l| l.split_whitespace().next())
.map(str::to_string)
.collect();
all.sort();
assert_eq!(all.len(), 9, "3 commits + 3 trees + 3 blobs");
let first = all[0].clone();
let owner = "did:key:zAbortCursorOwner";