mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 16:07:15 +02:00
Add test and commentary for "phantom autorenew" in pendingDelete
This documents some slightly spooky behavior around domains that have an expiration time within their pendingDelete window (meaning the whole period from DomainDeleteFlow running to the actual deletionTime, not just the 5-day pendingDelete grace period). They will experience an autorenew in terms of expiration time and grace period status due to cloneProjectedAtTime(), but without the usual artifacts of an autorenew (billing event and poll message). ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=149019980
This commit is contained in:
parent
fa5607c3e1
commit
f663f00251
2 changed files with 10 additions and 0 deletions
|
@ -155,6 +155,10 @@ public final class DomainDeleteFlow implements TransactionalFlow {
|
|||
now.plus(registry.getRedemptionGracePeriodLength()),
|
||||
clientId)))
|
||||
.setDeletePollMessage(Key.create(deletePollMessage));
|
||||
// Note: The expiration time is unchanged, so if it's before the new deletion time, there will
|
||||
// be a "phantom autorenew" where the expiration time advances but no billing event or poll
|
||||
// message are produced (since we are ending the autorenew recurrences at "now" below). For
|
||||
// now at least this is working as intended.
|
||||
}
|
||||
DomainResource newDomain = builder.build();
|
||||
updateForeignKeyIndexDeletionTime(newDomain);
|
||||
|
|
|
@ -311,6 +311,7 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
GracePeriod.create(GracePeriodStatus.TRANSFER, TIME_BEFORE_FLOW.plusDays(1), "foo", null));
|
||||
// We should see exactly one poll message, which is for the autorenew 1 month in the future.
|
||||
assertPollMessages(createAutorenewPollMessage("TheRegistrar").build());
|
||||
DateTime originalExpirationTime = domain.getRegistrationExpirationTime();
|
||||
clock.advanceOneMilli();
|
||||
runFlowAssertResponse(readFile(responseFilename, substitutions));
|
||||
DomainResource resource = reloadResourceByForeignKey();
|
||||
|
@ -324,6 +325,11 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
.hasOneHistoryEntryEachOfTypes(
|
||||
HistoryEntry.Type.DOMAIN_CREATE,
|
||||
HistoryEntry.Type.DOMAIN_DELETE);
|
||||
// We leave the original expiration time unchanged; if the expiration time is before the
|
||||
// deletion time, that means once it passes the domain will experience a "phantom autorenew"
|
||||
// where the expirationTime advances and the grace period appears, but since the delete flow
|
||||
// closed the autorenew recurrences immediately, there are no other autorenew effects.
|
||||
assertAboutDomains().that(resource).hasRegistrationExpirationTime(originalExpirationTime);
|
||||
// All existing grace periods that were for billable actions should cause cancellations.
|
||||
assertAutorenewClosedAndCancellationCreatedFor(
|
||||
renewBillingEvent,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue