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

Added logging, comments and improved error messaging + fixed bug in parallelization test suite #1487

Merged
merged 1 commit into from
Jul 24, 2017
Merged

Added logging, comments and improved error messaging + fixed bug in parallelization test suite #1487

merged 1 commit into from
Jul 24, 2017

Conversation

selenareneephillips
Copy link
Contributor

Changes:

  1. Implemented logging information for the parallelization test suite so debugging intermittent errors on Team City will be easier
  2. Added source code comments to clarify how the verification of parallelization is done for blocks of methods expected to be executing in parallel.
  3. Improved error messages for failures in the verification of parallelization so that they are more helpful in pinpointing the reasons for failures
  4. Make the execution state tracker final and changed the reset method to remove logs rather than reassign the variable with a new list. This was because Intellij warned me that a non-final variable for holding the event logs could cause problems with threads getting a lock on it.
  5. Fixed a bug in the calculation of the expected size of the last block of methods to execute in parallel when processing event logs for test methods which do not use data providers without factories.

…rallelizations is done for methods expected to be executing simultaneously in different threads. Adding logging to help diagnose interimittent failures on TeamCity. Make the execution state tracker final and changed the reset method to remove logs rather than reassign the variable with a new list. Fixed a bug in the calculation of the expected size of the last block of methods to execute in parallel when processing event logs for test methods which do not use data providers without factories.
@selenareneephillips
Copy link
Contributor Author

One of the test runs stalled out, but in some other test suite, so it seems unrelated to the parallelization test suite. I can't seem to find a re-run button, so had to close and reopen the pull request to force a rebuild to occur.

@selenareneephillips
Copy link
Contributor Author

The second run had another failure, but it's one I have seen intermittently before -- the concurrent modification test.

BTW, this test is failing on my local env:

Gradle Test Executor 2 STANDARD_OUT
Failures in :TestNG, :Regression2
test.issue565.Issue565Test.ThereShouldNotBeDeadlockWhenGroupByInstanceAndGroupDependencyUsed()
StackTrace:
java.lang.AssertionError: expected [82] but found [24]
at test.issue565.Issue565Test.ThereShouldNotBeDeadlockWhenGroupByInstanceAndGroupDependencyUsed(Issue565Test.java:39)
at com.sun.proxy.$Proxy2.stop(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
... Removed 49 stack frames

@selenareneephillips
Copy link
Contributor Author

I have been searching for hours for information about how to get gradle to display logging statements sent to the console from java.util.logging. Does anyone know how to do that? I really don't want to write a bunch of System.out.println statements replace the user of a real logger.

@krmahadevan
Copy link
Member

@selenareneephillips - Can you please check if this helps ?

@selenareneephillips
Copy link
Contributor Author

@krmahadevan I tried out those suggestions -- find the parent ConsoleHandler, using a customer logging.properties file, etc. Still, when I run 'gradle test' I still see no output from my loggers. When I run the tests in IntelliJ, I get output from my loggers. Running the command line, I get nothing from them.

Copy link
Member

@juherr juherr left a comment

Choose a reason for hiding this comment

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

LGTM 👍
Ping @cbeust

@juherr
Copy link
Member

juherr commented Jul 23, 2017

@selenareneephillips Only the committers of the repository are able to rerun build.

ThereShouldNotBeDeadlockWhenGroupByInstanceAndGroupDependencyUsed is another random test I introduced with #1477 and #1478 should help but I saw random results with it too. :/

About the gradle/travisci issue, I agree and it is a real pain when a test is failing. I am opening an issue because we should improve it

@cbeust cbeust merged commit b47fc4e into testng-team:master Jul 24, 2017
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