test: Update duplicate detection tests

This commit is contained in:
Jeremie Fraeys 2026-02-23 14:14:21 -05:00
parent fa97521488
commit ab20212d07
No known key found for this signature in database
2 changed files with 7 additions and 7 deletions

View file

@ -20,7 +20,7 @@ func TestDuplicateDetection(t *testing.T) {
if hash1 != hash2 {
t.Error("Same args should produce same hash")
}
t.Logf("Same args produce same hash: %s", hash1)
t.Logf("Same args produce same hash: %s", hash1)
// Test 2: Different args = not duplicate
args3 := "--epochs 20 --lr 0.01" // Different
@ -29,7 +29,7 @@ func TestDuplicateDetection(t *testing.T) {
if hash1 == hash3 {
t.Error("Different args should produce different hashes")
}
t.Logf("Different args produce different hashes: %s vs %s", hash1, hash3)
t.Logf("Different args produce different hashes: %s vs %s", hash1, hash3)
// Test 3: Same dataset specs = same dataset_id
ds1 := []queue.DatasetSpec{{Name: "mnist", Checksum: "sha256:abc123"}}
@ -41,7 +41,7 @@ func TestDuplicateDetection(t *testing.T) {
if id1 != id2 {
t.Error("Same dataset specs should produce same ID")
}
t.Logf("Same dataset specs produce same ID: %s", id1)
t.Logf("Same dataset specs produce same ID: %s", id1)
// Test 4: Different dataset = different ID
ds3 := []queue.DatasetSpec{{Name: "cifar10", Checksum: "sha256:def456"}}
@ -50,7 +50,7 @@ func TestDuplicateDetection(t *testing.T) {
if id1 == id3 {
t.Error("Different datasets should produce different IDs")
}
t.Logf("Different datasets produce different IDs: %s vs %s", id1, id3)
t.Logf("Different datasets produce different IDs: %s vs %s", id1, id3)
// Test 5: Composite key logic
t.Log("\n=== Composite Key Detection ===")

View file

@ -40,7 +40,7 @@ func TestDuplicateDetectionProcess(t *testing.T) {
// Verify they're the same
if datasetID1 == datasetID2 && paramsHash1 == paramsHash2 {
t.Log(" DUPLICATE DETECTED - same composite key!")
t.Log(" DUPLICATE DETECTED - same composite key!")
} else {
t.Error(" ✗ Should have been detected as duplicate")
}
@ -60,7 +60,7 @@ func TestDuplicateDetectionProcess(t *testing.T) {
// Verify they're different
if paramsHash1 != paramsHash3 {
t.Log(" NOT A DUPLICATE - different params_hash")
t.Log(" NOT A DUPLICATE - different params_hash")
} else {
t.Error(" ✗ Should have different params_hash")
}
@ -80,7 +80,7 @@ func TestDuplicateDetectionProcess(t *testing.T) {
// Verify they're different
if datasetID1 != datasetID4 {
t.Log(" NOT A DUPLICATE - different dataset_id")
t.Log(" NOT A DUPLICATE - different dataset_id")
} else {
t.Error(" ✗ Should have different dataset_id")
}