mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 16:07:15 +02:00
Disable memcache completely
We've determined that getting correctness semantics right, even in the few cases that it is possible to do so (see linked bug for audit) is not worth the bother in terms of highly complicated code and potential bugs. This CL turns off memcache at the Ofy level but doesn't rip out the annotations etc. so that we can quickly turn it back on if this turns out to have been a mistake. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=155227761
This commit is contained in:
parent
608e121a37
commit
275d6ddc10
7 changed files with 3 additions and 133 deletions
|
@ -25,7 +25,6 @@ import static google.registry.testing.DatastoreHelper.persistActiveContact;
|
|||
import static google.registry.testing.DatastoreHelper.persistActiveHost;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
import static google.registry.testing.MemcacheHelper.clearMemcache;
|
||||
import static google.registry.testing.MemcacheHelper.setMemcacheContents;
|
||||
import static google.registry.testing.TestDataHelper.loadFileWithSubstitutions;
|
||||
import static google.registry.util.DatastoreServiceUtils.KEY_TO_KIND_FUNCTION;
|
||||
|
||||
|
@ -56,7 +55,6 @@ import google.registry.model.domain.secdns.DelegationSignerData;
|
|||
import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.host.HostResource;
|
||||
import google.registry.model.index.ForeignKeyIndex;
|
||||
import google.registry.model.ofy.RequestCapturingAsyncDatastoreService;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import java.util.List;
|
||||
|
@ -635,29 +633,6 @@ public class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, Dom
|
|||
runFlow();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLoadsComeFromMemcache() throws Exception {
|
||||
persistTestEntities(false);
|
||||
setMemcacheContents(
|
||||
Key.create(domain),
|
||||
ForeignKeyIndex.createKey(domain),
|
||||
Key.create(registrant),
|
||||
Key.create(contact),
|
||||
Key.create(host1),
|
||||
Key.create(host2),
|
||||
Key.create(host3));
|
||||
int numPreviousReads = RequestCapturingAsyncDatastoreService.getReads().size();
|
||||
runFlowAssertResponse(loadFileWithSubstitutions(
|
||||
getClass(), "domain_info_response.xml", ImmutableMap.of("ROID", "2FF-TLD")));
|
||||
// Everything should be in memcache so nothing should hit datastore.
|
||||
int numReadsInFlow = RequestCapturingAsyncDatastoreService.getReads().size() - numPreviousReads;
|
||||
// TODO(b/27424173): This is 1 because there is no @Cache annotation on DomainBase, and we
|
||||
// don't want to blindly add it because that's a production change that adds potentially
|
||||
// dangerous caching. When the recommendations from the audit in b/27424173 are done and we've
|
||||
// tested the new safer caching this should be set to 0.
|
||||
assertThat(numReadsInFlow).isEqualTo(1);
|
||||
}
|
||||
|
||||
/** Test that we load contacts and hosts as a batch rather than individually. */
|
||||
@Test
|
||||
public void testBatchLoadingOfReferences() throws Exception {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue