[management] Require the stale-write update to succeed in the resurrection test

The test discarded the error from UpdateCustomDomain, so a rejected write would
have left the domain absent and the assertion would have passed without
exercising anything.
This commit is contained in:
mlsmaycon
2026-08-27 18:46:22 +00:00
parent d97ac90c99
commit 47b6fac78a

View File

@@ -315,8 +315,11 @@ func TestUpdateCustomDomain_DoesNotResurrectDeletedDomain(t *testing.T) {
require.Nil(t, storedDomain(t, env.store, accountA, "racy.example.com"), "the domain should be gone")
// What an in-flight validation would write once its CNAME check succeeded.
// The write has to succeed for the assertion below to mean anything: a
// rejected write would leave the domain absent for the wrong reason.
stale.Validated = true
_, _ = env.store.UpdateCustomDomain(ctx, accountA, stale)
_, err = env.store.UpdateCustomDomain(ctx, accountA, stale)
require.NoError(t, err, "the update itself must succeed, so absence is not just a failed write")
assert.Nil(t, storedDomain(t, env.store, accountA, "racy.example.com"),
"a late validation write must not recreate a deleted domain")