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

False cyclic dependency error #2945

Open
2 of 7 tasks
ayeracaris opened this issue Aug 9, 2023 · 1 comment
Open
2 of 7 tasks

False cyclic dependency error #2945

ayeracaris opened this issue Aug 9, 2023 · 1 comment

Comments

@ayeracaris
Copy link

ayeracaris commented Aug 9, 2023

TestNG Version

7.8.0

Expected behavior

Test class runs to completion

Actual behavior

org.testng.TestNGException: 
The following methods have cyclic dependencies:
AppTest.beforeClass1()[pri:0, instance:null]
AppTest.beforeClass2()[pri:0, instance:null]
AbstractTestBase.baseBeforeClass()[pri:0, instance:null]

	at org.testng.internal.Graph.topologicalSort(Graph.java:122)
	at org.testng.internal.MethodHelper.topologicalSort(MethodHelper.java:376)
	at org.testng.internal.MethodHelper.sortMethods(MethodHelper.java:447)
	at org.testng.internal.MethodHelper.lambda$collectAndOrderMethods$1(MethodHelper.java:76)
	at org.testng.util.TimeUtils.computeAndShowTime(TimeUtils.java:45)
	at org.testng.internal.MethodHelper.collectAndOrderMethods(MethodHelper.java:72)
	at org.testng.internal.TestNGMethodFinder.findConfiguration(TestNGMethodFinder.java:212)
	at org.testng.internal.TestNGMethodFinder.getAfterGroupsConfigurationMethods(TestNGMethodFinder.java:110)
	at org.testng.TestClass.initMethods(TestClass.java:205)
	at org.testng.TestClass.init(TestClass.java:102)
	at org.testng.TestClass.<init>(TestClass.java:66)
	at org.testng.TestRunner.initMethods(TestRunner.java:483)
	at org.testng.TestRunner.init(TestRunner.java:356)
	at org.testng.TestRunner.init(TestRunner.java:309)
	at org.testng.TestRunner.<init>(TestRunner.java:184)
	at org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(SuiteRunner.java:652)
	at org.testng.SuiteRunner.init(SuiteRunner.java:224)
	at org.testng.SuiteRunner.<init>(SuiteRunner.java:116)
	at org.testng.TestNG.createSuiteRunner(TestNG.java:1375)
	at org.testng.TestNG.createSuiteRunners(TestNG.java:1349)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1191)
	at org.testng.TestNG.runSuites(TestNG.java:1114)
	at org.testng.TestNG.run(TestNG.java:1082)
	at com.intellij.rt.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:66)
	at com.intellij.rt.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:105)

Is the issue reproducible on runner?

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

Test case sample

test.tar.gz

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.

@ayeracaris
Copy link
Author

It turns out that overriding "baseBeforeClass()" in my sample in AppTest effects a workaround.

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

No branches or pull requests

1 participant