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

Enable ParallelSuiteTest #2687

Merged
merged 5 commits into from Dec 12, 2021

Conversation

dsankouski
Copy link
Contributor

Presumably, test was disabled to get rid of distraction during development
and was forgotten.

Test was broken and commented out temporary back in 2011 in
cc950e9 commit, named Temp commit.
Commit was introduced in AllDynamic branch

Test is green both on the base commit of AllDynamic branch (10a202a) as well as on branch merge point (b251fce)

Add test: child suite should obey threadCount parameter

Tests for #2686
Fixes # .

Did you remember to?

  • Add test case(s)
  • Update CHANGES.txt
  • Auto applied styling via ./gradlew autostyleApply

@dsankouski dsankouski marked this pull request as draft December 1, 2021 17:49
@juherr juherr linked an issue Dec 4, 2021 that may be closed by this pull request
7 tasks
@juherr
Copy link
Member

juherr commented Dec 4, 2021

Thanks for the report and the test. Do you want to try a fix? It will help us a lot.

@krmahadevan
Copy link
Member

@dsankouski - The tests are currently failing mostly due to a formatter violation. Can you please take a look at this document https://github.com/cbeust/testng/blob/master/.github/CONTRIBUTING.md and fix the formatting issues and then update this PR so that we can see if the tests are all passing in CI as well ?

@dsankouski
Copy link
Contributor Author

@krmahadevan , I fixed formatting. Not sure, how to retrigger CI on draft PRs, though

@dsankouski
Copy link
Contributor Author

@juherr, yes, I'm planning to fix that :)

@krmahadevan
Copy link
Member

@dsankouski - No worries. The update on the PR triggered the tests and now I see test failures.

Presumably, test was disabled to get rid of distraction during development
and was forgotten.

Test was broken and commented out temporary back in 2011 in
cc950e9 commit, named `Temp commit`.
Commit was introduced in `AllDynamic` branch

Test is green both on the base commit of AllDynamic branch (10a202a) as well as on branch merge point (b251fce)

Done:
- Add test: child suite should obey threadCount parameter
- Move private stuff to bottom, add more details in error message
Before this, populateSuiteGraph method was ignoring any suite runner with child suites.
This leads to parallel suites not being executed with `randomize suite` option enabled

The method now add all nodes, including parents into the graph.
@@ -79,10 +59,10 @@ public void suitesShouldRunInParallel4() {
5,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test implies excluding duplicating suite files from run, which current code DOES NOT. Should we really exclude them? Or just change test case expected results.
My opinion would be to keep this as it is, since no one complained since 2011. @krmahadevan @juherr

More details:
expectedThreadCount and expectedSuiteCount is 5 in this test.

However suite graph is created with 8 nodes, resulting in 8 suites(with duplicates) run, as follows:

suite-parallel-1.xml suite-parallel-2.xml suite-parallel-2-1.xml suite-parallel-2-2.xml
                                |                                            |
                                |                                            |
                      ---------- ---------|                                  v
                      v                   v                         suite-parallel-2-2-1.xml
            suite-parallel-2-1.xml suite-parallel-2-2.xml
                                                     |
                                                     |
                                                     v
                                            suite-parallel-2-2-1.xml

Copy link
Member

Choose a reason for hiding this comment

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

@dsankouski - I dont think anyone in the real world would be trying to run the same suite multiple times by passing it multiple times. That perhaps is why no one complained. But assuming if anyone has been doing it and TestNG never complained, pruning for duplicates is going to cause complaints. So as you suggest, I also agree that we should just leave it as is (dont prune the duplicate suites), but just adjust the expectations of the test to satisfy the current behaviour.

@juherr WDYT ?

Copy link
Member

Choose a reason for hiding this comment

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

I loved that visual representation :) Helps clarify the question a lot @dsankouski

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@juherr , pushing changed expected results solution, while waiting for you reply to check if it works and CI passes.

Copy link
Member

Choose a reason for hiding this comment

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

I don't understand why the current expectedSuiteCount is 5.
If not 8, it should be 4, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

distinct suite name count is 5 in the graph: suite-parallel-1.xml suite-parallel-2.xml suite-parallel-2-1.xml suite-parallel-2-2.xml suite-parallel-2-2-1.xml

Copy link
Member

Choose a reason for hiding this comment

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

Ok, got it. Thanks for the clarification.

8 or 5 looks good for me.

@krmahadevan you choose.

This test implied a requirement to exclude duplicating suite files from run.
For example, for suite graph like:

suite-parallel-1.xml suite-parallel-2.xml suite-parallel-2-1.xml suite-parallel-2-2.xml
                                |                                            |
                                |                                            |
                      ---------- ---------|                                  v
                      v                   v                         suite-parallel-2-2-1.xml
            suite-parallel-2-1.xml suite-parallel-2-2.xml
                                                     |
                                                     |
                                                     v
                                            suite-parallel-2-2-1.xml

a test expected 5 suites and 5 threads.

However, this test was excluded from TestNG unit tests since 2011, and broken somewhere later
on the timeline. Dropping mentioned requirement (i.e. leaving things as it is now),
since there's no complains on current behaviour by adjusting test expected results, to
8 expected suites and 8 threads.
@dsankouski dsankouski marked this pull request as ready for review December 10, 2021 12:14
@krmahadevan
Copy link
Member

@dsankouski - I think we again have failures because a subsequent commit from you broke the formatting asks. Can you please fix it by running './gradlew autostyleApply' and add those changes as well ?

s.setThreadCount(this.m_threadCount);
}
processParallelModeCommandLineArgs(s);
s.getChildSuites().forEach(this::processParallelModeCommandLineArgs);
Copy link
Member

Choose a reason for hiding this comment

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

Child suites of child suites won't be configured. But I can't remember if TestNG supports child-child-suites.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

make processParallelModeCommandLineArgs(s); recursive

- revert  suite order
- gradle autostyle apply
- set parallel mode recursively
@krmahadevan krmahadevan merged commit f264982 into testng-team:master Dec 12, 2021
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.

Child suite does not obey threadCount parameter
4 participants