Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion tests/hypercache_distmemory_remove_readrepair_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,12 @@ func TestDistMemoryReadRepair(t *testing.T) {

const key = "rr-key"

// Setup uses RF=2 with 2 nodes registered — Lookup must return both.
// A <2 result indicates a test-environment regression rather than a
// benign condition.
owners := dc.Ring.Lookup(key)
if len(owners) < 2 {
t.Skip("replication factor <2")
t.Fatalf("expected >=2 owners with RF=2 setup, got %d", len(owners))
}

item := &cache.Item{Key: key, Value: "val"}
Expand Down
6 changes: 5 additions & 1 deletion tests/hypercache_distmemory_stale_quorum_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,13 @@ func TestDistMemoryStaleQuorum(t *testing.T) {

const key = "sq-key"

// Setup uses RF=3 with 3 nodes registered — Lookup must return all
// three. A non-3 result indicates a test-environment regression
// (e.g., a node failed to join membership), not a benign condition
// to skip past.
owners := dc.Ring.Lookup(key)
if len(owners) != 3 {
t.Skip("replication factor !=3")
t.Fatalf("expected 3 owners with RF=3 setup, got %d", len(owners))
}

item := &cache.Item{Key: key, Value: "v1"}
Expand Down
30 changes: 17 additions & 13 deletions tests/integration/dist_phase1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,14 @@ func awaitNodeReplication(ctx context.Context, node *backend.DistMemory, key str
return false
}

// TestDistPhase1BasicQuorum is a scaffolding test verifying three-node quorum Set/Get over HTTP transport.
// TestDistPhase1BasicQuorum verifies three-node quorum Set/Get over the
// HTTP transport. Originally a scaffolding test that t.Skipf'd when
// replication hadn't propagated to the third node ("hint replay not yet
// observable" — true at the time the test was written). Hint replay is
// now fully wired (TestHintedHandoffReplay, TestDistFailureRecovery),
// so the test now asserts strictly: every owner must hold the value
// within the 3 s deadline. A failure here means the HTTP-transport
// replication path regressed.
func TestDistPhase1BasicQuorum(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -112,19 +119,16 @@ func TestDistPhase1BasicQuorum(t *testing.T) {

assertValue(t, got.Value)

if awaitNodeReplication(ctx, nodeC, "k1", 3*time.Second) {
return
}

it, ok := nodeC.Get(ctx, "k1")
if !ok {
t.Skipf("hint replay not yet observable; will be validated after full wiring (missing item)")

return
}
// Replication must reach C within deadline; the previous skip-on-miss
// branches were placeholders for pre-hint-replay behavior. Locally
// this completes in ~500 ms across 20 runs.
if !awaitNodeReplication(ctx, nodeC, "k1", 3*time.Second) {
it, present := nodeC.Get(ctx, "k1")
Comment on lines +122 to +126
if !present {
t.Fatalf("nodeC never received replicated value within 3s")
}

if !valueOK(it.Value) {
t.Skipf("value mismatch after wait")
t.Fatalf("nodeC has wrong value after wait: %T %v", it.Value, it.Value)
}
}

Expand Down
Loading