Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TimedOutTestsListener to print the full thread dump on test timeout #4749

Closed
wants to merge 1 commit into from

Conversation

windie
Copy link
Member

@windie windie commented Jan 24, 2016

Motivation:

See #3172

Modifications:

Copy TimedOutTestsListener from Apache Hadoop(https://github.com/apache/hadoop/blob/d1c6accb6f87b08975175580e15f1ff1fe29ab04/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/TimedOutTestsListener.java) into the "common" project and add output.flush(). If not calling flush, the output may be printed to the console.

In addition, also update the pom.xmls to set up the timeout listener.

This is a workaround before junit adds such listener (junit-team/junit4#463).

Result:

If a test is set the timeout paramter using junit's @Test(timeout = ...) and the timeout is triggered, a full stack trace dump will be outputted and also output the deadlocks if any.

Motivation:

See netty#3172

Modifications:

Copy TimedOutTestsListener from Apache Hadoop(https://github.com/apache/hadoop/blob/d1c6accb6f87b08975175580e15f1ff1fe29ab04/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/TimedOutTestsListener.java) into the "common" project and add `output.flush()`. If not calling `flush`, the output may be printed to the console.

In addition, also update the `pom.xml`s to set up the timeout listener.

This is a workaround before junit adds such listener (junit-team/junit4#463).

Result:

If a test is set the timeout paramter using junit's `@Test(timeout = ...)` and the timeout is triggered, a full stack trace dump will be outputted and also output the deadlocks if any.
@windie
Copy link
Member Author

windie commented Jan 24, 2016

From the CI log, looks it doesn't run mvn install before mvn validate.

@@ -0,0 +1,175 @@
/*
* Copyright 2012 The Netty Project
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2016?

Also should there be another license from the original source code (assuming this was forked from somewhere else)?

@windie
Copy link
Member Author

windie commented Jan 26, 2016

@Scottmitch - do you know how to fix the build issue?

@Scottmitch
Copy link
Member

@windie - I would need to investigate. However see https://maven.apache.org/plugins/maven-jar-plugin/examples/create-test-jar.html:

In order to let Maven resolve all test-scoped transitive dependencies you should create a separate project.

@windie
Copy link
Member Author

windie commented Jan 26, 2016

@Scottmitch - Yeah, but it's talking about a separate project, not module. I cannot find an approach to avoid so many verbose dependencies in the same project. I think it's better to put this one in the netty project.

@trustin
Copy link
Member

trustin commented Feb 19, 2016

@windie How about netty/netty-build? https://github.com/netty/netty-build

We have some generic build-related stuff there so it's probably better putting it there as well.

@windie
Copy link
Member Author

windie commented Feb 20, 2016

Closed. Submit netty/netty-build#6 instead.

@windie windie closed this Feb 20, 2016
@windie windie deleted the timeout-listener branch February 20, 2016 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants