-
Notifications
You must be signed in to change notification settings - Fork 1k
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
TestNG execution hangs with version 7.9 or higher, with large amount of test cases #3152
Comments
@bapszy - Can you please help share a sample that can be used to reproduce the problem. I ask this because given the nature of your issue, its not going to be easy to identify the root cause without a sample. Please feel free to create a simple project that doesnt use any other library apart from TestNG, which we can use to reproduce the issue |
Hi, @bapszy. Please help share a Minimal, Reproducible Example that can be used to recreate the issue. In addition to sharing a sample, please also add the following details:
It would be better if you could share a sample project that can be directly used to reproduce the problem. |
@krmahadevan As I mentioned it only happens whith large amount of test cases, I don't know how to create an example for that which doesn't take long time to create and still can reproduce the issue. Writing 200+ fake tests seems to be a hard work. Our alltest suite runs for more then 1 hour, on a complex system of Appium, GitlabRunners, Mac test machines which runs the Android emulators and iOS Simulators. If you can help me with any suggestions with it. I'm happy to answer any questions, you have. We are using Gradle 8.8 It happens when we run our big test suites in Gitlab. (locally it would take a whole day to run all tests on 1 thread) |
@bapszy I hear you. But please help me understand how do I go about debugging this problem to find out what is going wrong. There is no information that you have shared so far. I would atleast need to know what your code does. Which is why I am asking for a sample to reproduce. |
@bapszy We have a similar setup, and I at-least have not encountered any such issue. Here is our environment:
Also, I do use testng suite xml file and have around 100 tests which altogether take about 1.5-2 hours on when running in non-parallel mode. However i do not have any methods annotated with @AfterSuite. This issue may be related to how your pipeline is configured to run tests or Appium client server communication. Please share your build.gradle to see how you have configured TestNG as well as command which you use to run tests. Without any example to reproduce, it is hard to debug. |
In our build.gradle configured this:
And we start the test run in the GitLab yml: Currently I'm working on going through the snapshots with a binary search to see if I can find the commit from which the problem occurs |
There is apparently nothing wrong here. Run your tests with gradle debug mode, as well as enabled debug mode logging in GitLab if there is one. This will help to see what is going on after the very last test has finished executing. You can also check Appium Server logs to see whats going on if there is some test execution stuck, or put some logging statements to see at which test or configuration method execution hangs. |
This Snaphot version is where it starts to fail: If I'm right this is the corresponding pull request: |
@krmahadevan I don't see version 7.11.0, only the 7.10.2 What is the correct way of enabling TestNG logging? We tried the log4testng.properties but it doesn't work |
TestNG now uses the standard slf4j for its logging purposes. So you can use your favorite implementation (log4j or jul logger) to configure the slf4j logger and dump logs. |
Hi again, |
@krmahadevan Is it something testNG calls? |
No. That looks like some connection manager at work cleaning stale http connections. |
I am not sure what may have happened there. I personally have not paid a lot of attention to snapshot jars because there is hardly anyone who asks for it. |
Hi, looks like I have the same problem. The amount of tests is 250, approx. 15 failed and 15 skipped.
It looks like @AfterSuite hooks not starting after every test completed. |
TestNG Version
7.9 and all newer versions
Expected behavior
Tests run, reports generated, test run finished successfully.
Actual behavior
When running large amount of test cases (200+) despite the last test case was finished, exetution doeasn't stop, build is terminated after timeout only.
We use Appium with TestNG for mobile testing in GitLab, on linux runners. This happens only with the large alltest suites. We run tests parallel, and don't use DataProvider or parametrization.
We use Gradle to execute tests with useTestNG().
Everything works with version 7.8, but none of the newer versions. I tried to debug on our side but could not find the cause. AfterMethod runs, but AfterSuite doesn't start, both have the alwaysrun=true set. I couldn't figure out what happens in between.
Please help. Thanks.
Is the issue reproducible on runner?
Test case sample
Contribution guidelines
Incase you plan to raise a pull request to fix this issue, please make sure you refer our Contributing section for detailed set of steps.
The text was updated successfully, but these errors were encountered: