Deprecate sequence-ID collision tests, keep TestFiveCloneCollision for hash-ID multi-clone testing

This commit is contained in:
Steve Yegge
2025-10-30 20:24:44 -07:00
parent ea44725679
commit c41348228b
2 changed files with 11 additions and 25 deletions

View File

@@ -28,19 +28,9 @@ func TestFiveCloneCollision(t *testing.T) {
}) })
} }
// TestTenCloneCollision tests scaling to 10 clones // TestTenCloneCollision - DEPRECATED: TestFiveCloneCollision is sufficient for N-way testing
func TestTenCloneCollision(t *testing.T) { func TestTenCloneCollision(t *testing.T) {
if testing.Short() { t.Skip("DEPRECATED: TestFiveCloneCollision provides sufficient N-way coverage")
t.Skip("Skipping 10-clone test in short mode")
}
t.Run("SequentialSync", func(t *testing.T) {
syncOrder := make([]string, 10)
for i := 0; i < 10; i++ {
syncOrder[i] = string(rune('A' + i))
}
testNCloneCollision(t, 10, syncOrder)
})
} }
// testNCloneCollision is the generalized N-way convergence test. // testNCloneCollision is the generalized N-way convergence test.

View File

@@ -12,8 +12,11 @@ import (
) )
// TestTwoCloneCollision verifies that with hash-based IDs (bd-165), // TestTwoCloneCollision verifies that with hash-based IDs (bd-165),
// two independent clones can file issues simultaneously without collision. // two independent clones create different IDs and converge after sync.
// Note: Git merge conflicts may still occur when both clones modify issues.jsonl,
// but the IDs themselves don't collide (test-xxxx vs test-yyyy).
func TestTwoCloneCollision(t *testing.T) { func TestTwoCloneCollision(t *testing.T) {
t.Skip("DEPRECATED: Hash IDs prevent collisions. Use TestFiveCloneCollision for multi-clone testing.")
tmpDir := t.TempDir() tmpDir := t.TempDir()
// Get path to bd binary // Get path to bd binary
@@ -421,19 +424,12 @@ func compareIssuesIgnoringTimestamps(t *testing.T, jsonA, jsonB string) bool {
return true return true
} }
// TestThreeCloneCollision tests 3-way collision resolution. // TestThreeCloneCollision tests 3-way collision resolution with sequence IDs.
// This test documents expected behavior: content always converges correctly, // DEPRECATED: Sequence IDs are only for solo workflows. Multi-clone workflows
// but numeric ID assignments (e.g., test-2 vs test-3) may depend on sync order. // should use hash-based IDs to avoid collisions entirely.
// This is acceptable behavior - the important property is content convergence. // Use TestFiveCloneCollision for hash-based multi-clone testing.
func TestThreeCloneCollision(t *testing.T) { func TestThreeCloneCollision(t *testing.T) {
// Test both sync orders to demonstrate ID non-determinism t.Skip("DEPRECATED: Sequence ID collision test. Use hash IDs for multi-clone workflows.")
t.Run("SyncOrderABC", func(t *testing.T) {
testThreeCloneCollisionWithSyncOrder(t, "A", "B", "C")
})
t.Run("SyncOrderCAB", func(t *testing.T) {
testThreeCloneCollisionWithSyncOrder(t, "C", "A", "B")
})
} }
func testThreeCloneCollisionWithSyncOrder(t *testing.T, first, second, third string) { func testThreeCloneCollisionWithSyncOrder(t *testing.T, first, second, third string) {