|
|
@ -30,6 +30,10 @@ func TestTombstoneGC(t *testing.T) { |
|
|
|
t.Fatalf("should fail") |
|
|
|
t.Fatalf("should fail") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if gc.PendingExpiration() { |
|
|
|
|
|
|
|
t.Fatalf("should not be pending") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
start := time.Now() |
|
|
|
start := time.Now() |
|
|
|
gc.Hint(100) |
|
|
|
gc.Hint(100) |
|
|
|
|
|
|
|
|
|
|
@ -38,6 +42,10 @@ func TestTombstoneGC(t *testing.T) { |
|
|
|
gc.Hint(120) |
|
|
|
gc.Hint(120) |
|
|
|
gc.Hint(125) |
|
|
|
gc.Hint(125) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if !gc.PendingExpiration() { |
|
|
|
|
|
|
|
t.Fatalf("should be pending") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
select { |
|
|
|
select { |
|
|
|
case index := <-gc.ExpireCh(): |
|
|
|
case index := <-gc.ExpireCh(): |
|
|
|
end := time.Now() |
|
|
|
end := time.Now() |
|
|
@ -75,9 +83,17 @@ func TestTombstoneGC_Expire(t *testing.T) { |
|
|
|
t.Fatalf("should fail") |
|
|
|
t.Fatalf("should fail") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if gc.PendingExpiration() { |
|
|
|
|
|
|
|
t.Fatalf("should not be pending") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
gc.Hint(100) |
|
|
|
gc.Hint(100) |
|
|
|
gc.Reset() |
|
|
|
gc.Reset() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if gc.PendingExpiration() { |
|
|
|
|
|
|
|
t.Fatalf("should not be pending") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
select { |
|
|
|
select { |
|
|
|
case <-gc.ExpireCh(): |
|
|
|
case <-gc.ExpireCh(): |
|
|
|
t.Fatalf("shoudl be reset") |
|
|
|
t.Fatalf("shoudl be reset") |
|
|
|