Skip to content

Commit 1754322

Browse files
committed
Skip aggregateQueryInATransactionShouldLockTheCountedDocuments when running against prod (b/248152832)
1 parent a7e90dd commit 1754322

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

google-cloud-firestore/src/test/java/com/google/cloud/firestore/ITQueryCountTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import static com.google.common.truth.Truth.assertThat;
2121
import static java.util.Collections.singletonMap;
2222
import static org.junit.Assert.assertThrows;
23+
import static org.junit.Assume.assumeTrue;
2324

2425
import com.google.api.core.ApiFuture;
2526
import com.google.auto.value.AutoValue;
@@ -215,6 +216,11 @@ public void aggregateQueryShouldWorkInATransaction() throws Exception {
215216

216217
@Test
217218
public void aggregateQueryInATransactionShouldLockTheCountedDocuments() throws Exception {
219+
assumeTrue(
220+
"Skip this test when running against production because "
221+
+ "it appears that production is failing to lock the counted documents b/248152832",
222+
isRunningAgainstFirestoreEmulator());
223+
218224
CollectionReference collection = createEmptyCollection();
219225
DocumentReference document = createDocumentInCollection(collection);
220226
CountDownLatch aggregateQueryExecutedSignal = new CountDownLatch(1);
@@ -388,6 +394,11 @@ private static void await(ApiFuture<?> future) throws InterruptedException {
388394
executor.shutdown();
389395
}
390396

397+
/** Returns whether the tests are running against the Firestore emulator. */
398+
private boolean isRunningAgainstFirestoreEmulator() {
399+
return firestore.getOptions().getHost().startsWith("localhost:");
400+
}
401+
391402
@AutoValue
392403
abstract static class CreatedCollectionInfo {
393404

0 commit comments

Comments
 (0)