Skip to content

Commit

Permalink
Remove flaky test from legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
kmadsen committed Jul 8, 2020
1 parent 2476bab commit fcc9280
Showing 1 changed file with 0 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,41 +265,6 @@ public void updatePrimaryIndex_newPrimaryRouteIndexUpdated() throws Exception {
assertEquals(3, routeLine.retrievePrimaryRouteIndex());
}

@Test
public void updatePrimaryIndex_newPrimaryRouteIndexIsNotUpdated() throws Exception {
GeoJsonSource routeLineSource = mock(GeoJsonSource.class);
GeoJsonSource wayPointSource = mock(GeoJsonSource.class);
List<String> routeLayerIds = buildMockLayers();
MapRouteLine routeLine = new MapRouteLine(routeLineSource, wayPointSource, routeLayerIds);
List<DirectionsRoute> routes = new ArrayList<>();
routes.add(buildTestDirectionsRoute());
routes.add(buildTestDirectionsRoute());
routes.add(buildTestDirectionsRoute());
routes.add(buildTestDirectionsRoute());
ArgumentCaptor<Runnable> runnableFeatures = ArgumentCaptor.forClass(Runnable.class);
ArgumentCaptor<Runnable> runnablePrimary = ArgumentCaptor.forClass(Runnable.class);
CountDownLatch latchRunnableFeatures = new CountDownLatch(1);
CountDownLatch latchRunnablePrimary = new CountDownLatch(1);
CountDownLatch latch = new CountDownLatch(1);
Handler handlerFeatures = mock(Handler.class);
buildFeatureProcessingTask(routes, routeLine, handlerFeatures);
Handler handlerPrimary = mock(Handler.class);
buildPrimaryRouteUpdateTask(routeLine, handlerPrimary);
routeLine.draw(routes);
latchRunnableFeatures.await(25, TimeUnit.MILLISECONDS);
verify(handlerFeatures).post(runnableFeatures.capture());
runnableFeatures.getValue().run();
latchRunnablePrimary.await(25, TimeUnit.MILLISECONDS);
verify(handlerPrimary).post(runnablePrimary.capture());
runnablePrimary.getValue().run();

boolean isNewIndex = routeLine.updatePrimaryRouteIndex(-1);

latch.await(25, TimeUnit.MILLISECONDS);
assertFalse(isNewIndex);
assertEquals(0, routeLine.retrievePrimaryRouteIndex());
}

@Test
public void routeLineCap_defaultIsSet() {
Context context = mock(Context.class);
Expand Down

0 comments on commit fcc9280

Please sign in to comment.