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

JUnitReportReporter is too slow #2801

Closed
spkrka opened this issue Sep 13, 2022 · 1 comment · Fixed by #2802
Closed

JUnitReportReporter is too slow #2801

spkrka opened this issue Sep 13, 2022 · 1 comment · Fixed by #2802
Milestone

Comments

@spkrka
Copy link
Contributor

spkrka commented Sep 13, 2022

TestNG Version

Note: only the latest version is supported
Tested with 7.6.1 as well as manual builds from latest master

Expected behavior

JUnitReportReporter finishes in under a second.

Actual behavior

JUnitReportReporter takes over 140 seconds to run.

Output

10:20:51.969 [main] INFO  org.testng.internal.Utils - [TestNG] Time taken by org.testng.internal.ExitCodeListener@78b0ec3a: 0 ms
10:20:51.984 [main] INFO  org.testng.internal.Utils - [TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@642c6461: 15 ms
10:20:52.034 [main] INFO  org.testng.internal.Utils - [TestNG] Time taken by org.testng.reporters.jq.Main@2b44605c: 50 ms
10:20:52.034 [main] INFO  org.testng.internal.Utils - [TestNG] Time taken by org.testng.reporters.FailedReporter@55421b8d: 0 ms
10:20:52.062 [main] INFO  org.testng.internal.Utils - [TestNG] Time taken by org.testng.reporters.XMLReporter@13e00016: 28 ms
10:20:52.076 [main] INFO  org.testng.internal.Utils - [TestNG] Time taken by org.testng.reporters.EmailableReporter2@3f0ce0d1: 14 ms
10:23:13.320 [main] INFO  org.testng.internal.Utils - [TestNG] Time taken by org.testng.reporters.JUnitReportReporter@566c1e71: 141244 ms

The produced reports are about 400 KiB in size total, with 98 xml files and 592 test cases.

I have connected to the process with VisualVM and run the sampler. It shows that ~100% of the time is spent in getHostName(). I can make a PR to run that once instead of for every test case.

@spkrka
Copy link
Contributor Author

spkrka commented Sep 13, 2022

After applying #2802 I can observe:

10:50:21.541 [main] INFO  org.testng.internal.Utils - [TestNG] Time taken by org.testng.reporters.JUnitReportReporter@6bcdd6e4: 775 ms

@krmahadevan krmahadevan added this to the 7.6.2 milestone Nov 1, 2022
@krmahadevan krmahadevan modified the milestones: 7.6.2, 7.7.0 Dec 6, 2022
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 a pull request may close this issue.

2 participants