Skip to content

Commit c863d96

Browse files
authored
Fix test failures from internal presubmit (#2507)
* Change bundle protos package * Fix g3 test failures 1. Use proper executor service for spec tests. 2. Skip @hide annotated Task interface.
1 parent 88cda26 commit c863d96

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

firebase-firestore/src/test/java/com/google/firebase/firestore/LoadBundleTaskTest.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,20 @@ public class LoadBundleTaskTest {
6161

6262
@Test
6363
public void testImplementsAllTaskInterface() {
64+
// Check if the internal gms Hide annotation is accessible.
65+
Class hideClazz = null;
66+
try {
67+
hideClazz = Class.forName("com.google.android.gms.common.internal.Hide");
68+
} catch (ClassNotFoundException e) {
69+
// Swallow the exception.
70+
}
71+
6472
for (Method method : Task.class.getDeclaredMethods()) {
73+
// This method is annotated with @Hide, skipping.
74+
if (hideClazz != null && method.getAnnotation(hideClazz) != null) {
75+
continue;
76+
}
77+
6578
try {
6679
LoadBundleTask.class.getDeclaredMethod(method.getName(), method.getParameterTypes());
6780
} catch (NoSuchMethodException e) {

firebase-firestore/src/test/java/com/google/firebase/firestore/spec/SpecTestCase.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
import java.util.List;
9898
import java.util.Map;
9999
import java.util.Set;
100+
import java.util.concurrent.ExecutorService;
100101
import java.util.logging.Logger;
101102
import java.util.regex.Pattern;
102103
import java.util.stream.Collectors;
@@ -106,7 +107,7 @@
106107
import org.json.JSONException;
107108
import org.json.JSONObject;
108109
import org.junit.Test;
109-
import org.robolectric.android.util.concurrent.RoboExecutorService;
110+
import org.robolectric.android.util.concurrent.InlineExecutorService;
110111

111112
/**
112113
* Subclasses of SpecTestCase run a set of portable event specifications from JSON spec files
@@ -222,7 +223,7 @@ public abstract class SpecTestCase implements RemoteStoreCallback {
222223
private int snapshotsInSyncEvents = 0;
223224

224225
/** An executor to use for test callbacks. */
225-
private final RoboExecutorService backgroundExecutor = new RoboExecutorService();
226+
private final ExecutorService backgroundExecutor = new InlineExecutorService();
226227

227228
/** The current user for the SyncEngine. Determines which mutation queue is active. */
228229
private User currentUser;

0 commit comments

Comments
 (0)