mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 16:07:15 +02:00
Remove all vestiges of memcache
Memcache is already off but now it's not in the code anymore. This includes removing domain creation failfast, since that is actually slower now than just running the flow - all you gain is a non-transactional read over a transactional read, but the cost is that you always pay that read, which is going to drive up latency. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=158183506
This commit is contained in:
parent
445faab977
commit
ae039aa0d8
37 changed files with 29 additions and 341 deletions
|
@ -30,7 +30,6 @@ import static google.registry.testing.DatastoreHelper.deleteTld;
|
|||
import static google.registry.testing.DatastoreHelper.getHistoryEntries;
|
||||
import static google.registry.testing.DatastoreHelper.newContactResource;
|
||||
import static google.registry.testing.DatastoreHelper.newDomainApplication;
|
||||
import static google.registry.testing.DatastoreHelper.newDomainResource;
|
||||
import static google.registry.testing.DatastoreHelper.newHostResource;
|
||||
import static google.registry.testing.DatastoreHelper.persistActiveContact;
|
||||
import static google.registry.testing.DatastoreHelper.persistActiveDomain;
|
||||
|
@ -892,7 +891,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_alreadyExists_triggersFailfast() throws Exception {
|
||||
public void testFailure_alreadyExists() throws Exception {
|
||||
persistContactsAndHosts();
|
||||
persistActiveDomain(getUniqueIdFromCommand());
|
||||
try {
|
||||
|
@ -902,43 +901,11 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
|||
+ "Object with given ID (%s) already exists",
|
||||
getUniqueIdFromCommand());
|
||||
} catch (ResourceAlreadyExistsException e) {
|
||||
assertThat(e.isFailfast()).isTrue();
|
||||
assertAboutEppExceptions().that(e).marshalsToXml().and().hasMessage(
|
||||
String.format("Object with given ID (%s) already exists", getUniqueIdFromCommand()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* There is special logic that disallows a failfast for domains in add grace period and sunrush
|
||||
* add grace period, so make sure that they fail anyways in the actual flow.
|
||||
*/
|
||||
private void doNonFailFastAlreadyExistsTest(GracePeriodStatus gracePeriodStatus)
|
||||
throws Exception {
|
||||
// This doesn't fail fast, so it throws the regular ResourceAlreadyExistsException from run().
|
||||
persistContactsAndHosts();
|
||||
persistResource(newDomainResource(getUniqueIdFromCommand()).asBuilder()
|
||||
.addGracePeriod(GracePeriod.create(gracePeriodStatus, END_OF_TIME, "", null))
|
||||
.build());
|
||||
thrown.expect(
|
||||
ResourceAlreadyExistsException.class,
|
||||
String.format("Object with given ID (%s) already exists", getUniqueIdFromCommand()));
|
||||
try {
|
||||
runFlow();
|
||||
} catch (ResourceAlreadyExistsException e) {
|
||||
assertThat(e.isFailfast()).isFalse();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_alreadyExists_addGracePeriod() throws Exception {
|
||||
doNonFailFastAlreadyExistsTest(GracePeriodStatus.ADD);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_alreadyExists_sunrushAddGracePeriod() throws Exception {
|
||||
doNonFailFastAlreadyExistsTest(GracePeriodStatus.SUNRUSH_ADD);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_reserved() throws Exception {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue