7 files changed,
+17
−7
domains_cli_test.go
+3 −0
internal/console/apiinstancemove_home_test.go
+3 −0
internal/console/apiinteractive_test.go
+1 −0
internal/console/domainbuy_fix_test.go
+2 −2
internal/lease/tombstone_test.go
+3 −0
internal/registry/ha_duties_test.go
+2 −2
internal/relay/record_test.go
+3 −3
| index fec921a8a..a672161e2 100644 |
| --- a/domains_cli_test.go |
| +++ b/domains_cli_test.go |
| @@ -826,6 +826,9 @@ func TestRunDomainsInstanceCatchall(t *testing.T) { |
| if !strings.HasSuffix(fc.lastDetachPath, "/domains/*.teams.example.com") { |
| t.Fatalf("detach path = %s", fc.lastDetachPath) |
| } |
| + if !strings.Contains(buf.String(), "detached *.teams.example.com") { |
| + t.Fatalf("stdout = %q, want the detached confirmation", buf.String()) |
| + } |
| } |
| |
| // TestAPISessionDomainPlacements: domainPlacements GETs the placements door |
| index a04de01c5..eb44310d2 100644 |
| --- a/internal/console/apiinstancemove_home_test.go |
| +++ b/internal/console/apiinstancemove_home_test.go |
| @@ -213,6 +213,9 @@ func TestMoveDoorHomeStagingFromItsEdgesFile(t *testing.T) { |
| if code, _, out := rawReq(t, http.MethodPost, moveURL, token, `{"region":"ie"}`); code != http.StatusAccepted { |
| t.Fatalf("home with a data bucket = %d %s, want 202", code, out) |
| } |
| + if n := homeMoveRegistrations(t, fx); n != 1 { |
| + t.Fatalf("an accepted move registered %d moves, want 1", n) |
| + } |
| |
| // The list names the home by its name, and never as an empty code. |
| caps := map[string]placementCapability{ |
| index ec2d0cfa3..69c28f009 100644 |
| --- a/internal/console/apiinteractive_test.go |
| +++ b/internal/console/apiinteractive_test.go |
| @@ -368,6 +368,7 @@ func TestInteractiveRefusalsInOrder(t *testing.T) { |
| s.cli.instances.allow(hashToken(fx.alice), time.Now()) |
| code, h, out := ixGet(t, fx, ixHost, stranger) |
| assertNotFound(t, "2 a stranger", canonicalNotFound(t), code, h, out) |
| + ixNothingWritten(t, fx, ixHost, snap) |
| |
| steps := []step{ |
| {"3 host claims", fx.alice, ixHost, http.StatusConflict, claimInteractiveUnsupportedMsg, func() { s.cfg.HostClaim = false }}, |
| index 7dbca6960..dfa2b0633 100644 |
| --- a/internal/console/domainbuy_fix_test.go |
| +++ b/internal/console/domainbuy_fix_test.go |
| @@ -216,8 +216,8 @@ func TestCheckLimiterPerAccountAndDeployment(t *testing.T) { |
| f.setUser("owner" + f.acct.Sqid + "@example.com") |
| signUp(t, f.consoleFixture, browser, "limited") |
| status, _, body = postForm(t, browser, f.ts.URL+"/a/"+f.acct.Sqid+"/apps/kass/domains/check", map[string][]string{"csrf": {sessionToken(t, f.consoleFixture, browser)}, "name": {"shop.com"}}) |
| - if status != 429 { |
| - t.Errorf("browser budget: status %d", status) |
| + if status != 429 || !strings.Contains(body, domainBuyCopy["rate"]) { |
| + t.Errorf("browser budget: %d %s", status, body) |
| } |
| // Six independent paid accounts can spend at most 120 deployment tokens. |
| for i := 0; i < 6; i++ { |
| index 7ff69f51e..1ba75b0e9 100644 |
| --- a/internal/lease/tombstone_test.go |
| +++ b/internal/lease/tombstone_test.go |
| @@ -668,6 +668,9 @@ func TestLiftTombstoneAlreadyLifted(t *testing.T) { |
| t.Fatalf("already lifted: lifted %v err %v", lifted, err) |
| } |
| } |
| + if s.writeCount() != writes { |
| + t.Fatal("lifting a lifted tombstone again wrote") |
| + } |
| // An own tombstone that simply ran out is lifted too. |
| s.putLock(t, tombLoc, tombMove, 4, time.Now().Add(-48*time.Hour)) |
| writes = s.writeCount() |
| index 654fc541b..9bfddb863 100644 |
| --- a/internal/registry/ha_duties_test.go |
| +++ b/internal/registry/ha_duties_test.go |
| @@ -259,8 +259,8 @@ func TestHAAdoptDutyPersistence(t *testing.T) { |
| ctx := context.Background() |
| s := adoptState(t, r) |
| ok, err := r.CompareDuty(ctx, "shop.example.com", "life", s.Revision, DutyState{Basis: "adopted"}) |
| - if ok { |
| - t.Fatal("minted adoption without receipt") |
| + if ok || err != nil { |
| + t.Fatalf("adoption without a receipt = %v %v, want a refusal that is not an error", ok, err) |
| } |
| ok, err = r.CompareDuty(ctx, "shop.example.com", "life", s.Revision, DutyState{Basis: "local-release", HolderRef: "peer", HolderIID: "i-peer"}) |
| if err != nil || !ok { |
| index de6345014..1e8704707 100644 |
| --- a/internal/relay/record_test.go |
| +++ b/internal/relay/record_test.go |
| @@ -29,8 +29,8 @@ func TestRecordRoundTrip(t *testing.T) { |
| if _, err := PutRecord(ctx, s, "abc", "meet", &Record{}, "stale-etag"); !errors.Is(err, release.ErrCASConflict) { |
| t.Fatalf("stale put = %v, want CAS conflict", err) |
| } |
| - r, _, _ = GetRecord(ctx, s, "abc", "meet") |
| - if !r.Enabled || r.Op != 1 { |
| - t.Fatalf("record = %+v", r) |
| + r, got, err := GetRecord(ctx, s, "abc", "meet") |
| + if err != nil || !r.Enabled || r.Op != 1 || got != etag { |
| + t.Fatalf("record = %+v etag %q %v, want the put's etag %q", r, got, err, etag) |
| } |
| } |