1
0
mirror of https://github.com/google/nomulus synced 2026-04-23 17:50:49 +00:00

Retry flaky tests for ReplicateToDatastoreAction (#1226)

* Retry flaky tests for ReplicateToDatastoreAction

The occassional failures seem to be caused by the test Datastore.
This commit is contained in:
Weimin Yu
2021-06-29 17:12:02 -04:00
committed by GitHub
parent 78a750b7e1
commit 7adcbee5ad

View File

@@ -46,6 +46,7 @@ import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.junitpioneer.jupiter.RetryingTest;
public class ReplicateToDatastoreActionTest {
@@ -97,7 +98,7 @@ public class ReplicateToDatastoreActionTest {
RegistryConfig.overrideCloudSqlReplicateTransactions(false);
}
@Test
@RetryingTest(4)
public void testReplication() {
TestEntity foo = new TestEntity("foo");
TestEntity bar = new TestEntity("bar");
@@ -127,7 +128,7 @@ public class ReplicateToDatastoreActionTest {
assertThat(ofyTm().transact(() -> ofyTm().loadByKey(baz.key()))).isEqualTo(baz);
}
@Test
@RetryingTest(4)
public void testReplayFromLastTxn() {
TestEntity foo = new TestEntity("foo");
TestEntity bar = new TestEntity("bar");
@@ -149,7 +150,7 @@ public class ReplicateToDatastoreActionTest {
assertThat(ofyTm().transact(() -> ofyTm().loadByKeyIfPresent(foo.key()).isPresent())).isFalse();
}
@Test
@RetryingTest(4)
public void testUnintentionalConcurrency() {
TestEntity foo = new TestEntity("foo");
TestEntity bar = new TestEntity("bar");
@@ -184,7 +185,7 @@ public class ReplicateToDatastoreActionTest {
Level.WARNING, "Ignoring transaction 1, which appears to have already been applied.");
}
@Test
@RetryingTest(4)
public void testMissingTransactions() {
// Write a transaction (should have a transaction id of 1).
TestEntity foo = new TestEntity("foo");