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

NPE when retrieving Retry analyzer if none is defined #3145

Closed
2 of 7 tasks
javydreamercsw opened this issue Jun 27, 2024 · 3 comments
Closed
2 of 7 tasks

NPE when retrieving Retry analyzer if none is defined #3145

javydreamercsw opened this issue Jun 27, 2024 · 3 comments

Comments

@javydreamercsw
Copy link

TestNG Version

Note: only the latest version is supported

Expected behavior

Graciously return either null or a NoOp retry analizer.

Actual behavior

java.lang.NullPointerException: Cannot invoke "Object.equals(Object)" because "this.m_retryAnalyzerClass" is null

at org.testng.internal.BaseTestMethod.getRetryAnalyzerConsideringMethodParameters(BaseTestMethod.java:828)

at org.testng.internal.BaseTestMethod.getRetryAnalyzer(BaseTestMethod.java:693)

As you can see in the code below if m_retryAnalyzerClass is null a NPE will be thrown in line 828.

Screenshot 2024-06-27 at 3 50 24 PM

Is the issue reproducible on runner?

  • Shell
  • Maven
  • Gradle
  • Ant
  • Eclipse
  • IntelliJ
  • NetBeans

Test case sample

Please, share the test case (as small as possible) which shows the issue

Contribution guidelines

Incase you plan to raise a pull request to fix this issue, please make sure you refer our Contributing section for detailed set of steps.

Copy link

Hi, @javydreamercsw.
We need more information to reproduce the issue.

Please help share a Minimal, Reproducible Example that can be used to recreate the issue.

In addition to sharing a sample, please also add the following details:

  • TestNG version being used.
  • JDK version being used.
  • How was the test run (IDE/Build Tools)?
  • How does your build file (pom.xml | build.gradle | build.gradle.kts) look like ?

It would be better if you could share a sample project that can be directly used to reproduce the problem.
Reply to this issue when all information is provided, thank you.

@javydreamercsw
Copy link
Author

  • TestNG 7.10.2
  • JDK 17
  • Maven/IntelliJ
  • Can't share due to proprietary things in it.
    Sadly I was unable to reproduce outside of our proprietary code how that variable ends up being null but it started happening when moving from 7.10.0

@krmahadevan
Copy link
Member

@javydreamercsw without a sample not sure what can be done.

Please feel free to add a comment once you have a sample that can be used to reproduce the problem. Until then most likely we will close this issue.

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

No branches or pull requests

2 participants