Skip to content

Commit

Permalink
[netty#4171] Fix flacky test introduced by previous commit.
Browse files Browse the repository at this point in the history
Motivation:

SingleThreadEventExecutorTest was flacky.

Modifications:

Fixed flacky test.

Result:

No more test failures
  • Loading branch information
normanmaurer committed Aug 29, 2015
1 parent e556958 commit 1252f74
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
public class SingleThreadEventExecutorTest {

@Test
public void testThreadDetails() {
public void testThreadProperties() {
final AtomicReference<Thread> threadRef = new AtomicReference<Thread>();
SingleThreadEventExecutor executor = new SingleThreadEventExecutor(
null, new DefaultThreadFactory("test"), false) {
Expand All @@ -39,16 +39,13 @@ protected void run() {
}
};
ThreadProperties threadProperties = executor.threadProperties();
Assert.assertSame(threadProperties, executor.threadProperties());

Thread thread = threadRef.get();
Assert.assertEquals(thread.getId(), threadProperties.id());
Assert.assertEquals(thread.getName(), threadProperties.name());
Assert.assertEquals(thread.getPriority(), threadProperties.priority());
Assert.assertEquals(thread.getState(), threadProperties.state());
Assert.assertEquals(thread.isAlive(), threadProperties.isAlive());
Assert.assertEquals(thread.isDaemon(), threadProperties.isDaemon());
Assert.assertEquals(thread.isInterrupted(), threadProperties.isInterrupted());
Assert.assertTrue(threadProperties.stackTrace().length > 0);
executor.shutdownGracefully();
}
Expand Down

0 comments on commit 1252f74

Please sign in to comment.