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
Assure thread affinity #1783
Assure thread affinity #1783
Conversation
@juherr @cbeust - I have tried to implement the approach that I called out #1773 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM if all tests pass
@@ -22,4 +22,20 @@ | |||
* @return the priority of this task. | |||
*/ | |||
int getPriority(); | |||
|
|||
default long getCurrentThreadId() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO we don't need default method here because it is located into the internal package
No idea why Travis is not working for this specific PR. |
Here's the build results for this branch from my fork : https://travis-ci.org/krmahadevan/testng/builds/378773133 |
Closes testng-team#89, testng-team#1050, testng-team#1066, testng-team#1173, testng-team#1185 This PR aims at assuring that methods that fall under the below two use cases, all run on the same thread when classes are being run in parallel: * @test methods in a class are ordered by priority * @test methods have a single dependency on another method using “dependsOnMethods” attribute. The thread affinity feature is supposed to be “experimental” and it can be turned on via the JVM argument : -Dtestng.thread.affinity=true This feature is turned off by default just to ensure that we don’t have any users experiencing un-usual behavior.
7e2ef3c
to
5e6906a
Compare
The PR worth a minor release at least |
@dr29bart - Can you please quickly check if the fix works using TestNG |
hi, Is there someway I can test this without having to compile testng myself and without waiting for a new release? Like a development maven feed |
@cbeust - Snapshots aren't being updated to maven snapshot repository. Can you please help take a look ? https://oss.sonatype.org/content/repositories/snapshots/org/testng/testng/7.0.0-SNAPSHOT/ |
add parallel execution testng-team/testng#1185 testng-team/testng#1783
Hello! Is there any chance it will be released soon? |
@robinbobin25 Not planned yet but you can follow #1862 |
@krmahadevan is -Dtestng.thread.affinity=true fix also covers testng "timeout" with single thread. |
Nope. I dont think its related to "timeout". Its mainly to force dependent
methods to run on the same thread as their upstream methods.
But if you are asking what happens when I add a "timeout" attribute to an
"@test" method that depends on an upstream method, run with parallelism
enabled and with the JVM argument set as "-Dtestng.thread.affinity=true",
that I am not sure. I believe the "timeout" is always a special case,
because TestNG always runs methods that have "timeout" attributes in a
separate thread instead of the current one. So this JVM flag may not hold
true for these sort of methods. But no harm in quickly trying out. Can you
please help try it out quickly and post back your findings ?
|
Hi all, Any updates? Does it works? 7.0.0 version? |
@jacksonwen001 - What updates are you expecting? The latest released version of TestNG is |
Closes #89, #1050, #1066, #1173, #1185
This PR aims at assuring that methods that fall
under the below two use cases, all run on the
same thread when classes are being run in parallel:
another method using “dependsOnMethods” attribute.
The thread affinity feature is supposed to be
“experimental” and it can be turned on via the
JVM argument :
-Dtestng.thread.affinity=true
This feature is turned off by default just to
ensure that we don’t have any users experiencing
un-usual behavior.
Fixes #89, #1050, #1066, #1173, #1185
Did you remember to?
CHANGES.txt
We encourage pull requests that:
If your pull request involves fixing SonarQube issues then we would suggest that you please discuss this with the
TestNG-dev before you spend time working on it.