package host import ( "testing" "github.com/carlosframework/platform/internal/hostclaim" ) // m-2: the wake checkpoint observes committed after a missed probed, for the // same writer only. func TestPlan9Fix2WakeCheckpointCatchesUpOnlyForTheSameWriter(t *testing.T) { probing := plan9D1Session(hostclaim.PhaseLandingProbing, 11) committed := plan9D1Session(hostclaim.PhaseLandingCommitted, 11) a := &claimWakeAttempt{observed: probing} if !a.advance(committed, claimWakeContinue) { t.Fatal("an admitted writer lost its session across an unobserved probed") } if a.advance(plan9D1Session(hostclaim.PhaseLandingProbed, 11), claimWakeContinue) { t.Fatal("the checkpoint went backward") } b := &claimWakeAttempt{observed: probing} if b.advance(plan9D1Session(hostclaim.PhaseLandingCommitted, 12), claimWakeContinue) { t.Fatal("a new session was caught up to") } other := plan9D1Session(hostclaim.PhaseLandingCommitted, 11) other.Claim.Op.ID = "m2" if b.advance(other, claimWakeContinue) { t.Fatal("another op was caught up to") } }