mirror of
https://github.com/google/nomulus
synced 2026-01-07 22:15:30 +00:00
Attempt to fix flakey deleteExpiredDomain test (#1022)
* Attempt to fix flakey deleteExpiredDomain test Though hard to reproduce locally, the test_deletesThreeDomainsInOneRun test has failed multiple times on Kokoro. The root cause may be the non-transactional query executed by the Action object, which was by design. Observing that the other test never fails, this PR follows its behavior and adds a transactional query before invoking the action.
This commit is contained in:
@@ -126,6 +126,9 @@ class DeleteExpiredDomainsActionTest {
|
||||
DomainBase domain2 = persistNonAutorenewingDomain("veee2.tld");
|
||||
DomainBase domain3 = persistNonAutorenewingDomain("tarm3.tld");
|
||||
|
||||
// action.run() executes a non-transactional query by design but makes this test flaky.
|
||||
// Executing a transaction here seems to force the test Datastore to become up to date.
|
||||
assertThat(tm().loadByEntity(domain3).getStatusValues()).doesNotContain(PENDING_DELETE);
|
||||
action.run();
|
||||
|
||||
assertThat(tm().loadByEntity(domain1).getStatusValues()).contains(PENDING_DELETE);
|
||||
|
||||
Reference in New Issue
Block a user