Skip to content

Commit e6848ef

Browse files
tjleingThomas Leing
andauthored
fix(geo): Increase Geo timeout so that it runs successfully on a Pixel 3a XL (#2177)
* Increase Geo timeout so that it runs successfully on a Pixel 3a XL * Fix lint Co-authored-by: Thomas Leing <[email protected]>
1 parent dee1a81 commit e6848ef

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

testutils/src/main/java/com/amplifyframework/testutils/sync/SynchronousGeo.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
* performing various operations.
4141
*/
4242
public final class SynchronousGeo {
43+
private static final int TIMEOUT = 20 * 1000;
4344
private final GeoCategoryBehavior asyncDelegate;
4445

4546
private SynchronousGeo(GeoCategoryBehavior asyncDelegate) {
@@ -76,7 +77,7 @@ public static SynchronousGeo delegatingToAmplify() {
7677
* @throws GeoException if maps are not configured.
7778
*/
7879
public Collection<MapStyle> getAvailableMaps() throws GeoException {
79-
return Await.result(asyncDelegate::getAvailableMaps);
80+
return Await.result(TIMEOUT, asyncDelegate::getAvailableMaps);
8081
}
8182

8283
/**
@@ -86,7 +87,7 @@ public Collection<MapStyle> getAvailableMaps() throws GeoException {
8687
* @throws GeoException if default map is not configured.
8788
*/
8889
public MapStyle getDefaultMap() throws GeoException {
89-
return Await.result(asyncDelegate::getDefaultMap);
90+
return Await.result(TIMEOUT, asyncDelegate::getDefaultMap);
9091
}
9192

9293
/**
@@ -99,7 +100,7 @@ public MapStyle getDefaultMap() throws GeoException {
99100
public MapStyleDescriptor getMapStyleDescriptor(
100101
GetMapStyleDescriptorOptions options
101102
) throws GeoException {
102-
return Await.<MapStyleDescriptor, GeoException>result((onResult, onError) ->
103+
return Await.<MapStyleDescriptor, GeoException>result(TIMEOUT, (onResult, onError) ->
103104
asyncDelegate.getMapStyleDescriptor(options, onResult, onError));
104105
}
105106

@@ -115,7 +116,7 @@ public GeoSearchResult searchByText(
115116
String query,
116117
GeoSearchByTextOptions options
117118
) throws GeoException {
118-
return Await.<GeoSearchResult, GeoException>result((onResult, onError) ->
119+
return Await.<GeoSearchResult, GeoException>result(TIMEOUT, (onResult, onError) ->
119120
asyncDelegate.searchByText(query, options, onResult, onError));
120121
}
121122

@@ -131,7 +132,7 @@ public GeoSearchResult searchByCoordinates(
131132
Coordinates coordinates,
132133
GeoSearchByCoordinatesOptions options
133134
) throws GeoException {
134-
return Await.<GeoSearchResult, GeoException>result((onResult, onError) ->
135+
return Await.<GeoSearchResult, GeoException>result(TIMEOUT, (onResult, onError) ->
135136
asyncDelegate.searchByCoordinates(coordinates, options, onResult, onError));
136137
}
137138
}

0 commit comments

Comments
 (0)