Skip to content

Commit b384380

Browse files
committed
Remved potential race condition between stop and interrupt in testcase
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/io/trunk@1721360 13f79535-47bb-0310-9956-ffa450edef68
1 parent 22a39cb commit b384380

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/test/java/org/apache/commons/io/input/TailerTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,6 @@ public void testTailer() throws Exception {
250250
listener.clear();
251251

252252
// Stop
253-
tailer.stop();
254-
tailer=null;
255253
thread.interrupt();
256254
TestUtils.sleep(testDelayMillis * 4);
257255
write(file, "Line five");
@@ -261,6 +259,9 @@ public void testTailer() throws Exception {
261259
assertEquals("Expected init to be called", 1 , listener.initialised);
262260
assertEquals("fileNotFound should not be called", 0 , listener.notFound);
263261
assertEquals("fileRotated should be be called", 1 , listener.rotated);
262+
tailer.stop();
263+
tailer=null;
264+
264265
}
265266

266267
@Test

0 commit comments

Comments
 (0)