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

After upgrading to TestNG 7.5.0, setting ITestResult.status to FAILURE doesn't fail the test anymore #2771

Closed
3 tasks done
asolntsev opened this issue Jun 1, 2022 · 7 comments · Fixed by #2864 or #2872
Closed
3 tasks done
Milestone

Comments

@asolntsev
Copy link
Contributor

asolntsev commented Jun 1, 2022

TestNG Version

  • 7.5
  • 7.6.0

Given

A project with Listener (my custom "soft assert" listener) which marks ITestResult status as FAILURE after the test.

Expected behavior

I expect my test to fail.

Actual behavior

After upgrading to TestNG 7.5, my test doesn't fail anymore. It's a bug.

Is the issue reproducible on runner?

  • Maven
  • Gradle
  • IntelliJ

Test case sample

Please check this trivial project which stabely reproduces the problem:
https://github.com/asolntsev/testng-listeners-sample

@krmahadevan
Copy link
Member

Can you please check in 7.6.0 which is the latest released version @asolntsev

@asolntsev
Copy link
Contributor Author

@krmahadevan Just tried: the problem still reproduced with TestNG 7.6.0

asolntsev added a commit to selenide/selenide that referenced this issue Jun 6, 2022
TestNG 7.5 and 7.6.0 have a bug testng-team/testng#2771 which break Selenide soft asserts. We may upgrade to a newer TestNG only when this issues gets fixed.
asolntsev added a commit to selenide/selenide that referenced this issue Jun 6, 2022
TestNG 7.5 and 7.6.0 have a bug testng-team/testng#2771 which break Selenide soft asserts. We may upgrade to a newer TestNG only when this issues gets fixed.
@dr29bart
Copy link
Contributor

dr29bart commented Jun 8, 2022

is it a result of this fix: #2558 ?
TestNG 7.6.0

listeners = {ArrayList@5308}  size = 6
 0 = {ExitCodeListener@5311} 
 1 = {ConfigurationAwareTestNGReporter@5312} 
 2 = {TextReporter@5313} 
 3 = {JUnitXMLReporter@5314} 
 4 = {TestHTMLReporter@5315} 
 5 = {CustomSoftAssert@5316} 

image

TestNG 7.4.0

this.m_notifier.getTestListeners() = {ArrayList@5006}  size = 6
 0 = {CustomSoftAssert@5066} 
 1 = {TestHTMLReporter@5067} 
 2 = {JUnitXMLReporter@5068} 
 3 = {TextReporter@5069} 
 4 = {ConfigurationAwareTestNGReporter@5070} 
 5 = {ExitCodeListener@5071} 

image

@asolntsev
Copy link
Contributor Author

@dr29bart Yes, it seems so. Generally, the idea to preserve the order of listeners is good. But still, TestNG own listeners should be executed AFTER all user-defined listeners (after test execution).

@hornyja4
Copy link

hornyja4 commented Jan 6, 2023

Hi guys, any progress in this? Totally agree with @asolntsev. This issue affected all our unit tests.

krmahadevan added a commit to krmahadevan/testng that referenced this issue Jan 7, 2023
@krmahadevan krmahadevan added this to the 7.8.0 milestone Jan 7, 2023
krmahadevan added a commit to krmahadevan/testng that referenced this issue Jan 7, 2023
krmahadevan added a commit to krmahadevan/testng that referenced this issue Jan 8, 2023
krmahadevan added a commit to krmahadevan/testng that referenced this issue Jan 30, 2023
krmahadevan added a commit to krmahadevan/testng that referenced this issue Jan 31, 2023
krmahadevan added a commit to krmahadevan/testng that referenced this issue Feb 1, 2023
krmahadevan added a commit to krmahadevan/testng that referenced this issue Feb 1, 2023
@YaroslavBurlakaLS
Copy link

YaroslavBurlakaLS commented Feb 8, 2023

Hi guys !
Can you please tell when this fix will be released ?
I lost a few hours trying to figure out what's wrong with newest TestNG because of this bug, solved it by a crutch, but this cruth caused another problem ofc
Reverted to older version ..

@krmahadevan
Copy link
Member

@YaroslavBurlakaLS - We are working on adding a few more fixes before 7.8.0 goes out. So this should be out hopefully by the end of this month.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants