mirror of
https://github.com/google/nomulus.git
synced 2025-04-30 12:07:51 +02: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:
parent
6d26f3cc0e
commit
bfe720ba1b
1 changed files with 5 additions and 4 deletions
|
@ -46,6 +46,7 @@ import org.junit.jupiter.api.AfterEach;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
|
import org.junitpioneer.jupiter.RetryingTest;
|
||||||
|
|
||||||
public class ReplicateToDatastoreActionTest {
|
public class ReplicateToDatastoreActionTest {
|
||||||
|
|
||||||
|
@ -97,7 +98,7 @@ public class ReplicateToDatastoreActionTest {
|
||||||
RegistryConfig.overrideCloudSqlReplicateTransactions(false);
|
RegistryConfig.overrideCloudSqlReplicateTransactions(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@RetryingTest(4)
|
||||||
public void testReplication() {
|
public void testReplication() {
|
||||||
TestEntity foo = new TestEntity("foo");
|
TestEntity foo = new TestEntity("foo");
|
||||||
TestEntity bar = new TestEntity("bar");
|
TestEntity bar = new TestEntity("bar");
|
||||||
|
@ -127,7 +128,7 @@ public class ReplicateToDatastoreActionTest {
|
||||||
assertThat(ofyTm().transact(() -> ofyTm().loadByKey(baz.key()))).isEqualTo(baz);
|
assertThat(ofyTm().transact(() -> ofyTm().loadByKey(baz.key()))).isEqualTo(baz);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@RetryingTest(4)
|
||||||
public void testReplayFromLastTxn() {
|
public void testReplayFromLastTxn() {
|
||||||
TestEntity foo = new TestEntity("foo");
|
TestEntity foo = new TestEntity("foo");
|
||||||
TestEntity bar = new TestEntity("bar");
|
TestEntity bar = new TestEntity("bar");
|
||||||
|
@ -149,7 +150,7 @@ public class ReplicateToDatastoreActionTest {
|
||||||
assertThat(ofyTm().transact(() -> ofyTm().loadByKeyIfPresent(foo.key()).isPresent())).isFalse();
|
assertThat(ofyTm().transact(() -> ofyTm().loadByKeyIfPresent(foo.key()).isPresent())).isFalse();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@RetryingTest(4)
|
||||||
public void testUnintentionalConcurrency() {
|
public void testUnintentionalConcurrency() {
|
||||||
TestEntity foo = new TestEntity("foo");
|
TestEntity foo = new TestEntity("foo");
|
||||||
TestEntity bar = new TestEntity("bar");
|
TestEntity bar = new TestEntity("bar");
|
||||||
|
@ -184,7 +185,7 @@ public class ReplicateToDatastoreActionTest {
|
||||||
Level.WARNING, "Ignoring transaction 1, which appears to have already been applied.");
|
Level.WARNING, "Ignoring transaction 1, which appears to have already been applied.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@RetryingTest(4)
|
||||||
public void testMissingTransactions() {
|
public void testMissingTransactions() {
|
||||||
// Write a transaction (should have a transaction id of 1).
|
// Write a transaction (should have a transaction id of 1).
|
||||||
TestEntity foo = new TestEntity("foo");
|
TestEntity foo = new TestEntity("foo");
|
||||||
|
|
Loading…
Add table
Reference in a new issue