parallel=class with static nested classes: Running testng.xml file works. Running class/package causes incorrect ordering
还没有人认领这个 Issue。
评估
调研方向
Reproduce with the linked testng_parallel_bug_issue_20240503 project, then compare the Eclipse class/package launch path with the testng.xml path. The issue says an ITestNGListener sets parallel=classes on the suite, but class/package launches behave like parallel=methods. Read how the plugin builds the suite for class/package selections versus an XML file, and inspect where nested static classes are collected and ordered. Done means class and package launches honor parallel=classes with the nested class, matching testng.xml behavior.
由索引模型根据 Issue 内容生成。
描述
Problem Statement
See prior report at https://groups.google.com/g/testng-users/c/KpPqUAzEVSw
A test project illustrating the problem is at https://github.com/RichMacDonald/testng_parallel_bug_issue_20240503
Using testing 7.10.2. Eclipse plugin version is 7.10.0.202404131040
I have a test class that includes a subclass of itself as a static inner class. So two classes in the same file, one class inheriting from the other.
I run all my tests with 'parallel=classes'. This is specified by an org.testng.ITestNGListener implementation that manually sets the property on the ISuite.
In Eclipse, when I select the class itself and launch testng, there is a single thread that calls @BeforeClass on BOTH classes before calling @BeforeMethod. In other words, the mode is running as 'parallel=methods'. I have verified that the ITestNGListener has been called first. This is the issue.
If I select the package itself and launch testng, the outcome is the same error.
If I select the project's textng.xml file, then it works correctly. With a single thread, all the methods in the first class are executed before the second class is begun.
If I move the static inner class to its own separate file, then everyone works correctly in all modes. Specifically, running testng on all classes in a package now works correctly. whereas it didn't before.
Any relate message in "Error Log" view
"Windows -> Show View -> Others -> Error Log"
None
The Dependency Management tool for your project
- Maven
- Gradle
- Ant
- Eclipse Buildpath (aka. Use "TestNG Library" for your project in Eclipse)
Operating System
- Windows
- Linux
- OSX
- 主要语言
- Java
- 星标
- 198
- 派生
- 163
- 平均合并
- 4 分钟
- 30 天内合并 PR
- 1
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
testng-team/testng-eclipse 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
testng-team/testng-eclipse#189 · 1 条评论 ·
-
难度 3/5 半天 新手友好度 62/100
testng-team/testng-eclipse#590 · 3 条评论 ·
-
难度 4/5 3-5 天 新手友好度 18/100
testng-team/testng-eclipse#589 · 2 条评论 ·
-
难度 4/5 3-5 天 新手友好度 22/100
testng-team/testng-eclipse#578 · 2 条评论 ·
-
难度 3/5 1-2 天 新手友好度 18/100
testng-team/testng-eclipse#565 · 1 条评论 ·
查看 testng-team/testng-eclipse 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
testng-team/testng#3672 ·
维护者通常 1 天内回复
-
triage
难度 2/5 1-3 小时 新手友好度 78/100
eclipse-edc/IdentityHub#1296 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 80/100
cloudfoundry/uaa#4194 ·
维护者通常 1 天内回复
-
area: ui priority: medium
难度 2/5 1-3 小时 新手友好度 83/100
tetsuji16/microProject#1721 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复