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

sporadic test failures due to java.lang.AssertionError at com.sun.tools.javac.comp.Check.checkFlags #8195

Open
mbien opened this issue Jan 25, 2025 · 0 comments
Labels
CI continuous integration changes Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) nb-javac Run nb-javac integration tests tests

Comments

@mbien
Copy link
Member

mbien commented Jan 25, 2025

org.netbeans.modules.java.hints.FieldForUnusedParamTest fails periodically in CI

testOrdering1, testMultipleCtors, testSimple1 and testSimple3 were all observed failing similarly

java.lang.AssertionError: Log:
Starting test testOrdering1
[org.netbeans.api.java.source.ElementHandle] THREAD: Test Watch Dog: testOrdering1 MSG: Resolved type is null for kind = PARAMETER signatures.length = 4
[org.netbeans.api.java.source.ElementHandle] THREAD: Test Watch Dog: testOrdering1 MSG: Cannot resolve: ElementHandle[kind=PARAMETER; sigs=test.Test <init> (III)V b ]
  at com.sun.tools.javac.comp.Check.checkFlags(Check.java:1293)
  at com.sun.tools.javac.comp.Enter.visitClassDef(Enter.java:506)
  at org.netbeans.lib.nbjavac.services.NBEnter.visitClassDef(NBEnter.java:62)
  at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:859)
  at com.sun.tools.javac.comp.Enter.classEnter(Enter.java:292)
  at com.sun.tools.javac.comp.Enter.classEnter(Enter.java:307)
  at com.sun.tools.javac.comp.Enter.visitTopLevel(Enter.java:391)
  at org.netbeans.lib.nbjavac.services.NBEnter.visitTopLevel(NBEnter.java:71)
  at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:555)
  at com.sun.tools.javac.comp.Enter.classEnter(Enter.java:292)
  at com.sun.tools.javac.comp.Enter.classEnter(Enter.java:307)
  at com.sun.tools.javac.comp.Enter.complete(Enter.java:620)
  at com.sun.tools.javac.comp.Enter.main(Enter.java:601)
  at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:1078)
  at com.sun.tools.javac.api.JavacTaskImpl.enter(JavacTaskImpl.java:345)
  at com.sun.tools.javac.api.JavacTaskImpl.ensureEntered(JavacTaskImpl.java:494)
  at com.sun.tools.javac.model.JavacElements.ensureEntered(JavacElements.java:887)
  at com.sun.tools.javac.model.JavacElements.doGetTypeElement(JavacElements.java:177)
  at com.sun.tools.javac.model.JavacElements.getTypeElement(JavacElements.java:166)
  at com.sun.tools.javac.model.JavacElements.getTypeElement(JavacElements.java:90)
  at org.netbeans.modules.java.source.save.ElementOverlay.resolve(ElementOverlay.java:198)
  at org.netbeans.modules.java.source.save.ElementOverlay.resolve(ElementOverlay.java:187)
  at org.netbeans.modules.java.source.save.ElementOverlay.unnamedPackage(ElementOverlay.java:428)
  at org.netbeans.modules.java.source.pretty.ImportAnalysis2.&lt;init&gt;(ImportAnalysis2.java:95)
  at org.netbeans.modules.java.source.pretty.ImportAnalysis2.&lt;init&gt;(ImportAnalysis2.java:85)
  at org.netbeans.api.java.source.WorkingCopy.processCurrentCompilationUnit(WorkingCopy.java:783)
  at org.netbeans.api.java.source.WorkingCopy.getChanges(WorkingCopy.java:1321)
  at org.netbeans.api.java.source.JavaSource$1.run(JavaSource.java:672)
  at org.netbeans.api.java.source.JavaSource$1.run(JavaSource.java:661)
  at org.netbeans.api.java.source.JavaSource$MultiTask.run(JavaSource.java:504)
  at org.netbeans.modules.parsing.impl.TaskProcessor.callUserTask(TaskProcessor.java:586)
  at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:197)
  at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:180)
  at org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:181)
  at org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:178)
  at org.netbeans.modules.masterfs.filebasedfs.utils.FileChangedManager.priorityIO(FileChangedManager.java:153)
  at org.netbeans.modules.masterfs.providers.ProvidedExtensions.priorityIO(ProvidedExtensions.java:335)
  at org.netbeans.modules.parsing.nb.DataObjectEnvFactory.runPriorityIO(DataObjectEnvFactory.java:118)
  at org.netbeans.modules.parsing.impl.Utilities.runPriorityIO(Utilities.java:67)
  at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:178)
  at org.netbeans.modules.parsing.api.ParserManager.parse(ParserManager.java:83)
  at org.netbeans.api.java.source.JavaSource.runUserActionTaskImpl(JavaSource.java:454)
  at org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:425)
  at org.netbeans.api.java.source.JavaSource.runModificationTask(JavaSource.java:680)
  at org.netbeans.modules.java.hints.FieldForUnusedParam$FixImpl.implement(FieldForUnusedParam.java:228)
  at org.netbeans.modules.java.hints.infrastructure.TreeRuleTestBase.performFixTest(TreeRuleTestBase.java:232)
  at org.netbeans.modules.java.hints.infrastructure.TreeRuleTestBase.performFixTest(TreeRuleTestBase.java:187)
  at org.netbeans.modules.java.hints.infrastructure.TreeRuleTestBase.performFixTest(TreeRuleTestBase.java:183)
  at org.netbeans.modules.java.hints.FieldForUnusedParamTest.testOrdering1(FieldForUnusedParamTest.java:86)
  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
  at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at org.netbeans.modules.java.hints.infrastructure.TreeRuleTestBase.runTest(TreeRuleTestBase.java:143)
  at org.netbeans.junit.NbTestCase.access$200(NbTestCase.java:83)
  at org.netbeans.junit.NbTestCase$2.doSomething(NbTestCase.java:488)
  at org.netbeans.junit.NbTestCase$1Guard.run(NbTestCase.java:409)
  at java.base/java.lang.Thread.run(Thread.java:840)

a second test (different base class) had a very similar stack trace, but it fails rarely:
testSimple: org.netbeans.modules.java.hints.errors.RenameConstructorTest

java.lang.AssertionError
  at com.sun.tools.javac.comp.Check.checkFlags(Check.java:1293)
  at com.sun.tools.javac.comp.Enter.visitClassDef(Enter.java:506)
  at org.netbeans.lib.nbjavac.services.NBEnter.visitClassDef(NBEnter.java:62)
  at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:859)
  at com.sun.tools.javac.comp.Enter.classEnter(Enter.java:292)
  at com.sun.tools.javac.comp.Enter.classEnter(Enter.java:307)
  at com.sun.tools.javac.comp.Enter.visitTopLevel(Enter.java:391)
  at org.netbeans.lib.nbjavac.services.NBEnter.visitTopLevel(NBEnter.java:71)
  at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:555)
  at com.sun.tools.javac.comp.Enter.classEnter(Enter.java:292)
  at com.sun.tools.javac.comp.Enter.classEnter(Enter.java:307)
  at com.sun.tools.javac.comp.Enter.complete(Enter.java:620)
  at com.sun.tools.javac.comp.Enter.main(Enter.java:601)
  at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:1078)
  at com.sun.tools.javac.api.JavacTaskImpl.enter(JavacTaskImpl.java:345)
  at com.sun.tools.javac.api.JavacTaskImpl.ensureEntered(JavacTaskImpl.java:494)
  at com.sun.tools.javac.model.JavacElements.ensureEntered(JavacElements.java:887)
  at com.sun.tools.javac.model.JavacElements.doGetTypeElement(JavacElements.java:177)
  at com.sun.tools.javac.model.JavacElements.getTypeElement(JavacElements.java:166)
  at com.sun.tools.javac.model.JavacElements.getTypeElement(JavacElements.java:90)
  at org.netbeans.modules.java.source.save.ElementOverlay.resolve(ElementOverlay.java:198)
  at org.netbeans.modules.java.source.save.ElementOverlay.resolve(ElementOverlay.java:187)
  at org.netbeans.modules.java.source.save.ElementOverlay.unnamedPackage(ElementOverlay.java:428)
  at org.netbeans.modules.java.source.pretty.ImportAnalysis2.<init>(ImportAnalysis2.java:95)
  at org.netbeans.modules.java.source.pretty.ImportAnalysis2.<init>(ImportAnalysis2.java:85)
  at org.netbeans.api.java.source.WorkingCopy.processCurrentCompilationUnit(WorkingCopy.java:783)
  at org.netbeans.api.java.source.WorkingCopy.getChanges(WorkingCopy.java:1321)
  at org.netbeans.api.java.source.ModificationResult$1.run(ModificationResult.java:121)
  at org.netbeans.modules.parsing.impl.TaskProcessor.callUserTask(TaskProcessor.java:586)
  at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:197)
  at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:180)
  at org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:181)
  at org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:178)
  at org.netbeans.modules.masterfs.filebasedfs.utils.FileChangedManager.priorityIO(FileChangedManager.java:153)
  at org.netbeans.modules.masterfs.providers.ProvidedExtensions.priorityIO(ProvidedExtensions.java:335)
  at org.netbeans.modules.parsing.nb.DataObjectEnvFactory.runPriorityIO(DataObjectEnvFactory.java:118)
  at org.netbeans.modules.parsing.impl.Utilities.runPriorityIO(Utilities.java:67)
  at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:178)
  at org.netbeans.modules.parsing.api.ParserManager.parse(ParserManager.java:83)
  at org.netbeans.api.java.source.ModificationResult.runModificationTask(ModificationResult.java:105)
  at org.netbeans.modules.java.hints.errors.RenameConstructor$RenameConstructorFix.implement(RenameConstructor.java:161)
  at org.netbeans.modules.java.hints.infrastructure.ErrorHintsTestBase.performFixTest(ErrorHintsTestBase.java:307)
  at org.netbeans.modules.java.hints.infrastructure.ErrorHintsTestBase.performFixTest(ErrorHintsTestBase.java:262)
  at org.netbeans.modules.java.hints.infrastructure.ErrorHintsTestBase.performFixTest(ErrorHintsTestBase.java:258)
  at org.netbeans.modules.java.hints.errors.RenameConstructorTest.testSimple(RenameConstructorTest.java:41)
  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
  at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at org.netbeans.junit.NbTestCase.access$200(NbTestCase.java:83)
  at org.netbeans.junit.NbTestCase$2.doSomething(NbTestCase.java:488)
  at org.netbeans.junit.NbTestCase$1Guard.run(NbTestCase.java:409)
  at java.base/java.lang.Thread.run(Thread.java:840)

unfortunately I couldn't reproduce it locally so far

@mbien mbien added Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) nb-javac Run nb-javac integration tests tests labels Jan 25, 2025
@mbien mbien added the CI continuous integration changes label Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI continuous integration changes Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) nb-javac Run nb-javac integration tests tests
Projects
None yet
Development

No branches or pull requests

1 participant