From 4e21152f047b0e4b9f31ab82f4d4a1cd8963d691 Mon Sep 17 00:00:00 2001 From: gbrodman Date: Thu, 18 Aug 2022 15:04:29 -0400 Subject: [PATCH] Add TestCacheExtension in ResourceFlowTC to fix flakes (#1749) Basically, what's happening here is that some flow tests are adding things to the claims list cache which is stored statically, meaning that some other tests can pick those up when they shouldn't. By adding the extension in RFTC, it'll clear out the caches after each test. --- .../java/google/registry/flows/ResourceFlowTestCase.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/src/test/java/google/registry/flows/ResourceFlowTestCase.java b/core/src/test/java/google/registry/flows/ResourceFlowTestCase.java index e4a1b8307..cd86a1087 100644 --- a/core/src/test/java/google/registry/flows/ResourceFlowTestCase.java +++ b/core/src/test/java/google/registry/flows/ResourceFlowTestCase.java @@ -40,6 +40,7 @@ import google.registry.model.tmch.ClaimsList; import google.registry.model.tmch.ClaimsListDao; import google.registry.testing.DatabaseHelper; import google.registry.testing.TaskQueueHelper.TaskMatcher; +import google.registry.testing.TestCacheExtension; import google.registry.util.JdkLoggerConfig; import google.registry.util.TypeUtils.TypeInstantiator; import java.util.logging.Level; @@ -48,6 +49,7 @@ import org.joda.time.DateTime; import org.joda.time.Duration; import org.json.simple.JSONValue; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.extension.RegisterExtension; /** * Base class for resource flow unit tests. @@ -60,6 +62,10 @@ public abstract class ResourceFlowTestCase