Skip to content

Commit 3900d3d

Browse files
committed
Remove problematic unit test. Tests that depend on Thread.sleep() are generally unreliable.
1 parent 8f0b7aa commit 3900d3d

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

src/test/java/org/broad/igv/tools/FeatureSearcherTest.java

-27
Original file line numberDiff line numberDiff line change
@@ -154,31 +154,4 @@ public FeatureSource<? extends Feature> getTestBedSource() throws IOException, T
154154
return TribbleFeatureSource.getFeatureSource(new ResourceLocator(path), genome);
155155
}
156156

157-
/**
158-
* Test that stopping actually stops the search.
159-
* We start searching a window which will never complete
160-
* @throws Exception
161-
*/
162-
@Test
163-
public void testCancel() throws Exception{
164-
FeatureSearcher searcher = new FeatureSearcher(getTestBedSource(), genome, "chr3", 0);
165-
searcher.setSearchIncrement(100);
166-
167-
// Be careful monkeying around here.
168-
// The test will exit and shut down the threadExecutor if there is nothing blocking on this thread
169-
// This can make it seem like the search aborted prematurely
170-
LongRunningTask.getThreadExecutor().execute(searcher);
171-
Thread.sleep(500);
172-
assertFalse(searcher.isDone());
173-
searcher.cancel();
174-
175-
//Stopping is not instantaneous
176-
int counter = 0;
177-
while(!searcher.isDone()){
178-
Thread.sleep(100);
179-
counter++;
180-
}
181-
assertNull(searcher.getResult());
182-
assertTrue(counter < 5);
183-
}
184157
}

0 commit comments

Comments
 (0)