throw SkipException in SuiteListener:onStart will hang start from 7.9.0 #3116
Replies: 5 comments 1 reply
-
|
I implemented the interface IAlterSuiteListener, and clear the tests conditionally. |
Beta Was this translation helpful? Give feedback.
-
|
hi Songbo Wang, I am experiencing same issue while executing my automation scripts. Can you plz provide a sample code snippet or please provide more details how you resolved this issue? Thanks in Advance. |
Beta Was this translation helpful? Give feedback.
-
|
I created a listener to implement interface IAlterSuiteListener |
Beta Was this translation helpful? Give feedback.
-
|
Hi all. I note that this is closed, presumably because there is a workaround, but I believe it still exists on 7.11.0 and should be fixed. Stack trace from Java 21.0.4: Example use-case: public interface ISomeFeatureTest extends WithEnvConfig {
@BeforeMethod(alwaysRun = true)
default void env_check() {
if (!getEnvConfig().isSomeFeatureEnabled()) {
throw new SkipException("Skipped until This Feature is deployed for this environment");
}
}
}It results in the tests running forever. We do this because the test suite could be run against various environments with various features enabled and we don't want to have to specify test groups, because that would require remembering what they are. |
Beta Was this translation helpful? Give feedback.
-
|
Related to #3238 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
We have lots of suites, and we use a centralized testng.xml with
Sometimes we want to skip some suites conditionally, so I add some logic in SuiteListener:onStart, and throw SkipException on some conditions.
Before release 7.8.0, this works.
But start from 7.9.0, there is a NPE error on thread, and the main job just hang there:
What is the suggested way to skip a suite conditionally?
I have append a simple project to reproduce the failures.
just run
mvn testin the project.test.zip
Beta Was this translation helpful? Give feedback.
All reactions