Skip to content

Commit 2d2afb1

Browse files
test(worker): document why TestCount is skipped
TestCount is t.Skip()'d on the branch, but the reason wasn't recorded. Investigation: the test launches concurrent transactions sharing entity uids and bypasses the Oracle's conflict-checking commit path — it just calls CommitToDisk() directly with disjoint commit timestamps. Both the legacy AddMutationWithIndex path and the new mutation pipeline fail it identically: with two threads adding edges to the same subject's [uid] @count predicate, neither path can serialize @count updates without real txn conflicts, so the count index ends up inconsistent and many subjects are missing from count(N). This is expected without conflict checking — the unit harness can't exercise the safety the Oracle provides. Re-enable when we wire either: (a) Oracle.WaitForTs/IsAborted into the harness, or (b) this test through worker.applyMutations() (which does invoke the Oracle conflict path). Single-thread TestCount passes, so the per-predicate pipeline's own count logic is correct in the absence of contention. The existing TestStringIndexWithLang covers the multithreaded happy path with disjoint uids. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
1 parent 8fbb0bd commit 2d2afb1

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

worker/sort_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,8 @@ func TestStringIndexWithLang(t *testing.T) {
301301
}
302302

303303
func TestCount(t *testing.T) {
304-
t.Skip()
304+
t.Skip("Inherently racy: bypasses the Oracle conflict-checking commit path. " +
305+
"Legacy and new pipeline both fail. Re-enable when the harness uses real txn conflicts.")
305306
// Setup temporary directory for Badger DB
306307
dir, err := os.MkdirTemp("", "storetest_")
307308
require.NoError(t, err)

0 commit comments

Comments
 (0)