Tests failing because of Leaked SDKs and sync roots issues.

Answered

All the tests were passing. Then we moved to a newer teamcity (on the cloud). Not sure about what exactly is the issue as I could not find any documentation related to Leaked SDKs issues

I am clearing the Sdk in tearDown() and the test start passing

SdkConfigurationUtil.removeSdk(systemJdk);

But there are still some tests that are failing with the following Throwable when clearing the Sdk. But just a few test fail now. Any ideas what is going on?

java.lang.Throwable: sync roots

Note: All tests are passing on the dev machine locally but failing on the new Teamcity cloud agents

Please see the lines in bold where Throwable: sync roots

Thanks for the help.

Show diff between expected and actual values

junit.framework.ComparisonFailure: expected:<...bj...> but was:<......>
at junit.framework.Assert.assertEquals(Assert.java:81)
at junit.framework.Assert.assertEquals(Assert.java:87)
at gw.gosu.ij.parameterinfo.AbstractParameterInfoTest.test(AbstractParameterInfoTest.java:76)
at gw.gosu.ij.parameterinfo.AbstractParameterInfoTest.test(AbstractParameterInfoTest.java:22)
at gw.gosu.ij.parameterinfo.MethodParameterInfoTest.testSDKMethodInvocationHighlightedSigniture(MethodParameterInfoTest.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at junit.framework.TestCase.runTest(TestCase.java:154)
at com.intellij.testFramework.UsefulTestCase.lambda$runTest$11(UsefulTestCase.java:339)
at com.intellij.testFramework.PlatformTestCase.lambda$invokeTestRunnable$19(PlatformTestCase.java:720)
at com.intellij.testFramework.PlatformTestCase.invokeTestRunnable(PlatformTestCase.java:732)
at com.intellij.testFramework.UsefulTestCase.runTest(UsefulTestCase.java:358)
at com.intellij.testFramework.PlatformTestCase.lambda$runBareImpl$18(PlatformTestCase.java:653)
at com.intellij.testFramework.EdtTestUtil$Companion$runInEdtAndWait$1.invoke(EdtTestUtil.kt:29)
at com.intellij.testFramework.EdtTestUtil$Companion$runInEdtAndWait$1.invoke(EdtTestUtil.kt:27)
at com.intellij.testFramework.EdtTestUtilKt$runInEdtAndWait$1.run(EdtTestUtil.kt:46)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:315)
at com.intellij.openapi.application.impl.LaterInvocator$1.run(LaterInvocator.java:158)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:424)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:407)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:822)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:650)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:366)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

------- Stdout: -------


19:40:40,527 DEBUG si.impl.cache.WorkingCopyCache - T15 >>> Project Cache CLEARED
19:40:40,527 DEBUG tellij.psi.impl.PsiManagerImpl - beforePropertyChange: element = null, propertyName = roots, oldValue = [Lcom.intellij.openapi.vfs.VirtualFile;@6169f970
19:40:40,527 DEBUG si.impl.cache.WorkingCopyCache - T15 >>> Project Cache CLEARED
19:40:40,527 DEBUG si.impl.cache.WorkingCopyCache - T15 >>> Project Cache CLEARED
19:40:40,528 DEBUG tellij.psi.impl.PsiManagerImpl - propertyChanged: element = null, propertyName = roots, oldValue = [Lcom.intellij.openapi.vfs.VirtualFile;@6169f970, newValue = [Lcom.intellij.openapi.vfs.VirtualFile;@314fc371
19:40:40,528 DEBUG pl.ProjectRootManagerComponent -
java.lang.Throwable: sync roots
at com.intellij.openapi.roots.impl.ProjectRootManagerComponent.doSynchronizeRoots(ProjectRootManagerComponent.java:273)
at com.intellij.openapi.roots.impl.ProjectRootManagerImpl.fireRootsChanged(ProjectRootManagerImpl.java:396)
at com.intellij.openapi.roots.impl.ProjectRootManagerImpl.access$200(ProjectRootManagerImpl.java:42)
at com.intellij.openapi.roots.impl.ProjectRootManagerImpl$BatchSession.rootsChanged(ProjectRootManagerImpl.java:102)
at com.intellij.openapi.roots.impl.ProjectRootManagerImpl.mergeRootsChangesDuring(ProjectRootManagerImpl.java:303)
at com.intellij.openapi.roots.impl.ProjectRootManagerImpl$JdkTableMultiListener.jdkRemoved(ProjectRootManagerImpl.java:586)
at sun.reflect.GeneratedMethodAccessor56.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:117)
at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:449)
at com.intellij.util.messages.impl.MessageBusImpl.pumpWaitingBuses(MessageBusImpl.java:410)
at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:399)
at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:380)
at com.intellij.util.messages.impl.MessageBusImpl.access$200(MessageBusImpl.java:45)
at com.intellij.util.messages.impl.MessageBusImpl$2.invoke(MessageBusImpl.java:231)
at com.sun.proxy.$Proxy76.jdkRemoved(Unknown Source)
at com.intellij.openapi.projectRoots.impl.ProjectJdkTableImpl.removeJdk(ProjectJdkTableImpl.java:209)
at com.intellij.openapi.projectRoots.impl.JavaAwareProjectJdkTableImpl.removeJdk(JavaAwareProjectJdkTableImpl.java:54)
at gw.gosu.ij.testframework.GosuTestCase.lambda$tearDown$0(GosuTestCase.java:65)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1003)
at gw.gosu.ij.testframework.GosuTestCase.tearDown(GosuTestCase.java:63)
at com.intellij.testFramework.PlatformTestCase.lambda$runBareImpl$18(PlatformTestCase.java:661)
at com.intellij.testFramework.EdtTestUtil$Companion$runInEdtAndWait$1.invoke(EdtTestUtil.kt:29)
at com.intellij.testFramework.EdtTestUtil$Companion$runInEdtAndWait$1.invoke(EdtTestUtil.kt:27)
at com.intellij.testFramework.EdtTestUtilKt$runInEdtAndWait$1.run(EdtTestUtil.kt:46)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:315)
at com.intellij.openapi.application.impl.LaterInvocator$1.run(LaterInvocator.java:158)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:424)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:407)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:822)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:650)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:366)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
0
2 comments

Check org.jetbrains.idea.maven.execution.MavenExecutionTest for a sample. If it still doesn't work please post link to your TestCase.

0

Also, fyi, there is a com.intellij.openapi.projectRoots.ProjectJdkTable#addJdk(com.intellij.openapi.projectRoots.Sdk, com.intellij.openapi.Disposable)

0

Please sign in to leave a comment.