parallel=class with static nested classes: Running testng.xml file works. Running class/package causes incorrect ordering
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Java
- Star
- 198
- Fork
- 163
- Merge trung bình
- 4 phút
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của testng-team/testng-eclipse
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
testng-team/testng-eclipse#189 · 1 bình luận ·
-
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 62/100
testng-team/testng-eclipse#590 · 3 bình luận ·
-
Some errors during update?Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 18/100
testng-team/testng-eclipse#589 · 2 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 22/100
testng-team/testng-eclipse#578 · 2 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 18/100
testng-team/testng-eclipse#565 · 1 bình luận ·
Tất cả issue của testng-team/testng-eclipse
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
testng-team/testng#3672 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
eclipse-edc/IdentityHub#1296 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
cloudfoundry/uaa#4194 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ui: 進捗状況線ダイアログが日本語表示で英語のままĐang mởarea: ui priority: medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
tetsuji16/microProject#1721 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày