eclipse-pde / eclipse.pde

Eclipse Public License 2.0
25 stars 64 forks source link

[win] NewFeatureProjectTestCase randomly failed #1265

Closed jukzi closed 4 months ago

jukzi commented 4 months ago

https://download.eclipse.org/eclipse/downloads/drops4/I20240513-1800/testresults/html/org.eclipse.pde.ui.tests_ep432I-unit-win32-java17_win32.win32.x86_64_17.html

Failed to delete P/com.junitTest.feature

java.lang.AssertionError: Failed to delete P/com.junitTest.feature
at org.eclipse.pde.ui.tests.PDETestCase.tearDown(PDETestCase.java:112)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
java.lang.AssertionError: Testing for existing java nature...
at org.junit.Assert.fail(Assert.java:89)
at org.junit.Assert.assertTrue(Assert.java:42)
at org.eclipse.pde.ui.tests.wizards.NewFeatureProjectTestCase.testJavaFeature(NewFeatureProjectTestCase.java:129)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)

can not reproduce locally, no recent commit to PDE

Project.hasNature(String) is already known to sometimes return wrong result - see https://github.com/eclipse-pde/eclipse.pde/issues/1185#issuecomment-2053715406 , https://github.com/eclipse-platform/eclipse.platform/pull/1312 /

during NewFeatureProjectTestCase org.eclipse.core.internal.resources.ProjectDescription.natures is accessed in multiple threads:

Thread [main] (Suspended (modification of field natures in ProjectDescription)) 
    owns: CreateFeatureProjectOperation  (id=239)   
    owns: RunnableLock  (id=240)    
    ProjectDescription.<init>() line: 125   
    Project.create(IProjectDescription, int, IProgressMonitor) line: 302    
    Project.create(IProjectDescription, IProgressMonitor) line: 291 
    Project.create(IProgressMonitor) line: 286  
    CoreUtility.createProject(IProject, IPath, IProgressMonitor) line: 96   
    CreateFeatureProjectOperation(AbstractCreateFeatureOperation).createProject(IProgressMonitor) line: 104 
    CreateFeatureProjectOperation(AbstractCreateFeatureOperation).createFeature(IProgressMonitor) line: 84  
    CreateFeatureProjectOperation(AbstractCreateFeatureOperation).execute(IProgressMonitor) line: 72    
    CreateFeatureProjectOperation(WorkspaceModifyOperation).lambda$0(AtomicReference, AtomicReference, IProgressMonitor) line: 112  
    0x000001df8074e1f8.run(IProgressMonitor) line: not available    
    Workspace.run(ICoreRunnable, ISchedulingRule, int, IProgressMonitor) line: 2451 
    Workspace.run(IWorkspaceRunnable, ISchedulingRule, int, IProgressMonitor) line: 2476    
    CreateFeatureProjectOperation(WorkspaceModifyOperation).run(IProgressMonitor) line: 131 
    ModalContext.runInCurrentThread(IRunnableWithProgress, IProgressMonitor) line: 434  
    ModalContext.run(IRunnableWithProgress, boolean, IProgressMonitor, Display) line: 354   
    ProgressMonitorJobsDialog(ProgressMonitorDialog).run(boolean, boolean, IRunnableWithProgress) line: 470 
    ProgressMonitorJobsDialog.run(boolean, boolean, IRunnableWithProgress) line: 230    
    ProgressManager.run(boolean, boolean, IRunnableWithProgress) line: 973  
    ProgressManager$RunnableWithStatus.run() line: 1105 
    BusyIndicator.showWhile(Display, Runnable) line: 67 
    ProgressManager.lambda$27(Display, ProgressManager$RunnableWithStatus) line: 985    
    0x000001df80955bb0.run() line: not available    
    UISynchronizer(Synchronizer).syncExec(Runnable) line: 183   
    UISynchronizer.syncExec(Runnable) line: 133 
    Display.syncExec(Runnable) line: 4814   
    ProgressManager.runInUI(IRunnableContext, IRunnableWithProgress, ISchedulingRule) line: 985 
    NewFeatureProjectTestCase.createFeature(FeatureData, boolean, Object) line: 75  
    NewFeatureProjectTestCase.testSimpleFeature() line: 117 
    NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]  
    NativeMethodAccessorImpl.invoke(Object, Object[]) line: 77  
    DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43  
    Method.invoke(Object, Object...) line: 568  
    FrameworkMethod$1.runReflectiveCall() line: 59  
    FrameworkMethod$1(ReflectiveCallable).run() line: 12    
    FrameworkMethod.invokeExplosively(Object, Object...) line: 56   
    InvokeMethod.evaluate() line: 17    
    RunBefores.evaluate() line: 26  
    RunAfters.evaluate() line: 27   
    TestWatcher$1.evaluate() line: 61   
    ParentRunner$3.evaluate() line: 306 
    BlockJUnit4ClassRunner$1.evaluate() line: 100   
    JUnit4(ParentRunner<T>).runLeaf(Statement, Description, RunNotifier) line: 366  
    JUnit4(BlockJUnit4ClassRunner).runChild(FrameworkMethod, RunNotifier) line: 103 
    JUnit4(BlockJUnit4ClassRunner).runChild(Object, RunNotifier) line: 63   
    ParentRunner$4.run() line: 331  
    ParentRunner$1.schedule(Runnable) line: 79  
    JUnit4(ParentRunner<T>).runChildren(RunNotifier) line: 329  
    ParentRunner<T>.access$100(ParentRunner, RunNotifier) line: 66  
    ParentRunner$2.evaluate() line: 293 
    ParentRunner$3.evaluate() line: 306 
    JUnit4(ParentRunner<T>).run(RunNotifier) line: 413  
    JUnitCore.run(Runner) line: 137 
    JUnitCore.run(Request) line: 115    
    RunnerExecutor.execute(RunnerTestDescriptor) line: 42   
    VintageTestEngine.executeAllChildren(VintageEngineDescriptor, EngineExecutionListener) line: 80 
    VintageTestEngine.execute(ExecutionRequest) line: 72    
    EngineExecutionOrchestrator.execute(TestDescriptor, EngineExecutionListener, ConfigurationParameters, TestEngine) line: 198 
    EngineExecutionOrchestrator.execute(LauncherDiscoveryResult, EngineExecutionListener) line: 169 
    EngineExecutionOrchestrator.execute(InternalTestPlan, EngineExecutionListener, TestExecutionListener) line: 93  
    EngineExecutionOrchestrator.lambda$execute$0(InternalTestPlan, TestExecutionListener) line: 58  
    0x000001df80922cb8.accept(Object) line: not available   
    EngineExecutionOrchestrator.withInterceptedStreams(ConfigurationParameters, ListenerRegistry<TestExecutionListener>, Consumer<TestExecutionListener>) line: 141 
    EngineExecutionOrchestrator.execute(InternalTestPlan, TestExecutionListener...) line: 57    
    DefaultLauncher.execute(InternalTestPlan, TestExecutionListener[]) line: 103    
    DefaultLauncher.execute(TestPlan, TestExecutionListener...) line: 94    
    DelegatingLauncher.execute(TestPlan, TestExecutionListener...) line: 52 
    SessionPerRequestLauncher.execute(TestPlan, TestExecutionListener...) line: 70  
    JUnit5TestReference.run(TestExecution) line: 100    
    TestExecution.run(ITestReference[]) line: 40    
    RemotePluginTestRunner(RemoteTestRunner).runTests(String[], String, TestExecution) line: 529    
    RemotePluginTestRunner(RemoteTestRunner).runTests(TestExecution) line: 757  
    RemotePluginTestRunner(RemoteTestRunner).run() line: 452    
    RemotePluginTestRunner.main(String[]) line: 83  
    PlatformUITestHarness.lambda$0() line: 45   
    0x000001df801f7de0.run() line: not available    
    E4Testable.lambda$1(Runnable) line: 127 
    0x000001df8078ece8.run() line: not available    
    RunnableLock.run(Display) line: 40  
    UISynchronizer(Synchronizer).runAsyncMessages(boolean) line: 132    
    Display.runAsyncMessages(boolean) line: 4058    
    Display.readAndDispatch() line: 3676    
    PartRenderingEngine$5.run() line: 1151  
    Realm.runWithDefault(Realm, Runnable) line: 339 
    PartRenderingEngine.run(MApplicationElement, IEclipseContext) line: 1042    
    E4Workbench.createAndRunUI(MApplicationElement) line: 152   
    Workbench.lambda$3(Display, WorkbenchAdvisor, int[]) line: 639  
    0x000001df802252f0.run() line: not available    
    Realm.runWithDefault(Realm, Runnable) line: 339 
    Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 546    
    PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 173   
    IDEApplication.start(IApplicationContext) line: 152 
    UITestApplication(NonUIThreadTestApplication).start(IApplicationContext) line: 58   
    EclipseAppHandle.run(Object) line: 208  
    EclipseAppLauncher.runApplication(Object) line: 143 
    EclipseAppLauncher.start(Object) line: 109  
    EclipseStarter.run(Object) line: 439    
    EclipseStarter.run(String[], Runnable) line: 271    
    NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]  
    NativeMethodAccessorImpl.invoke(Object, Object[]) line: 77  
    DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43  
    Method.invoke(Object, Object...) line: 568  
    Main.invokeFramework(String[], URL[]) line: 668 
    Main.basicRun(String[]) line: 605   
    Main.run(String[]) line: 1481   
    Main.main(String[]) line: 1454  

Thread [Worker-4: Updating workspace] (Suspended (access of field natures in ProjectDescription))   
    ProjectDescription.getNatureIds(boolean) line: 453  
    ProjectDescription.getNatureIds() line: 449 
    CheckMissingNaturesListener.updateMarkers(Collection<IProject>) line: 176   
    CheckMissingNaturesListener.resourceChanged(IResourceChangeEvent) line: 76  
    NotificationManager$1.run() line: 321   
    SafeRunner.run(ISafeRunnable) line: 47  
    NotificationManager.notify(ResourceChangeListenerList$ListenerEntry[], ResourceChangeEvent, boolean) line: 311  
    NotificationManager.broadcastChanges(ElementTree, ResourceChangeEvent, boolean) line: 174   
    Workspace.broadcastPostChange() line: 458   
    Workspace.endOperation(ISchedulingRule, boolean) line: 1586 
    Workspace.run(ICoreRunnable, ISchedulingRule, int, IProgressMonitor) line: 2465 
    NotificationManager$NotifyJob.run(IProgressMonitor) line: 60    
    Worker.run() line: 63   

Thread [Worker-3: EGit Hidden Resources Clean-up] (Suspended (access of field natures in ProjectDescription))   
    ProjectDescription.<init>() line: 125   
    Workspace.newProjectDescription(String) line: 2212  
    HiddenResources.createProject(IProject, IProgressMonitor) line: 282 
    HiddenResources.getHiddenProject(IProgressMonitor) line: 271    
    HiddenResources.initialize(IProgressMonitor) line: 127  
    0x0000020e4a2ac9e8.run(IProgressMonitor) line: not available    
    Job$2.run(IProgressMonitor) line: 187   
    Worker.run() line: 63   

Thread [Worker-6: Decoration Calculation] (Suspended (access of field natures in ProjectDescription))   
    ProjectDescription.getNatureIds(boolean) line: 453  
    ProjectDescription.hasNature(String) line: 490  
    Project.hasNature(String) line: 570 
    JavaProject.hasJavaNature(IProject) line: 407   
    JavaModelManager.getPerProjectInfoCheckExistence(IProject) line: 2602   
    JavaProject.getPerProjectInfo() line: 2353  
    JavaProject.getResolvedClasspath() line: 2426   
    JavaProject.findContainingClasspathEntry(IResource) line: 2716  
    JavaProject.isOnClasspath(IResource) line: 2700 
    BuildpathIndicatorLabelDecorator.getOverlay(Object) line: 49    
    BuildpathIndicatorLabelDecorator.decorate(Object, IDecoration) line: 35 
    LightweightDecoratorDefinition.decorate(Object, IDecoration) line: 254  
    LightweightDecoratorManager$LightweightRunnable.run() line: 105 
    SafeRunner.run(ISafeRunnable) line: 47  
    LightweightDecoratorManager.decorate(Object, DecorationBuilder, LightweightDecoratorDefinition) line: 359   
    LightweightDecoratorManager.getDecorations(Object, DecorationBuilder) line: 345 
    DecorationScheduler$1.queue(Object, boolean, IDecorationContext) line: 410  
    DecorationScheduler$1.run(IProgressMonitor) line: 388   
    Worker.run() line: 63   

Thread [Worker-1: Building] (Suspended (access of field natures in ProjectDescription)) 
    ProjectDescription.getNatureIds(boolean) line: 453  
    ProjectDescription.hasNature(String) line: 490  
    Project.hasNature(String) line: 570 
    DeltaProcessor.resourceChanged(IResourceChangeEvent) line: 2227 
    DeltaProcessingState.resourceChanged(IResourceChangeEvent) line: 501    
    NotificationManager$1.run() line: 321   
    SafeRunner.run(ISafeRunnable) line: 47  
    NotificationManager.notify(ResourceChangeListenerList$ListenerEntry[], ResourceChangeEvent, boolean) line: 311  
    NotificationManager.broadcastChanges(ElementTree, ResourceChangeEvent, boolean) line: 174   
    Workspace.broadcastBuildEvent(Object, int, int) line: 444   
    AutoBuildJob.doBuild(IProgressMonitor) line: 202    
    AutoBuildJob.run(IProgressMonitor) line: 300    
    Worker.run() line: 63   

Daemon Thread [Java indexing] (Suspended (access of field natures in ProjectDescription))   
    ProjectDescription.getNatureIds(boolean) line: 453  
    ProjectDescription.hasNature(String) line: 490  
    Project.hasNature(String) line: 570 
    JavaProject.hasJavaNature(IProject) line: 407   
    JavaProject.getEclipsePreferences() line: 1844  
    JavaProject.getOptions(boolean) line: 2113  
    IndexManager.getSourceElementParser(IJavaProject, ISourceElementRequestor) line: 396    
    IndexAllProject.execute(IProgressMonitor) line: 213 
    IndexManager(JobManager).indexerLoop() line: 542    
    0x0000020e4a5d79e8.run() line: not available    
    Thread.run() line: 840  
laeubi commented 4 months ago

The natures failure is a red herring here. The real cause is the failed deletion of the projects in the teardown so then the following test starts with a dirty working state, if one simply comment out the delete the test locally fails with the same error.