Tests are broken after updating platform version Follow
Answered
Hello,
I did the routine platform version update and also synced my plugin with the plugin template repo changes.
After doing that tests started to fail in GitHub actions. Locally tests seem to fail only on the first run. Repetitive test execution fixes the issue.
Error log that I observed:
com.pr1st0n.cflint.CFLintHighlightingTest > testGlobalVarChecker FAILED
com.intellij.testFramework.TestLogger$TestLoggerAssertionError at TestLogger.java:45
Caused by: com.intellij.diagnostic.PluginException at ComponentManagerImpl.kt:883
Caused by: java.lang.NoSuchMethodError at SafeJdomFactory.java:31
ERROR: 'void org.jdom.Attribute.<init>(java.lang.String, java.lang.String, org.jdom.AttributeType, org.jdom.Namespace)'
java.lang.NoSuchMethodError: 'void org.jdom.Attribute.<init>(java.lang.String, java.lang.String, org.jdom.AttributeType, org.jdom.Namespace)'
at com.intellij.openapi.util.SafeJdomFactory$BaseSafeJdomFactory.attribute(SafeJdomFactory.java:31)
at com.intellij.openapi.util.SafeStAXStreamBuilder.processElement(SafeStAXStreamBuilder.java:172)
at com.intellij.openapi.util.SafeStAXStreamBuilder.processElementFragment(SafeStAXStreamBuilder.java:120)
at com.intellij.openapi.util.SafeStAXStreamBuilder.build(SafeStAXStreamBuilder.java:94)
at com.intellij.openapi.util.JDOMUtil.load(JDOMUtil.java:319)
at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.initStandardFileTypes(FileTypeManagerImpl.java:315)
at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.initializeComponent(FileTypeManagerImpl.java:574)
at com.intellij.configurationStore.ComponentStoreImpl.initComponent(ComponentStoreImpl.kt:114)
at com.intellij.configurationStore.ComponentStoreWithExtraComponents.initComponent(ComponentStoreWithExtraComponents.kt:48)
at com.intellij.serviceContainer.ComponentManagerImpl.initializeComponent$intellij_platform_serviceContainer(ComponentManagerImpl.kt:535)
at com.intellij.serviceContainer.ServiceComponentAdapter.createAndInitialize(ServiceComponentAdapter.kt:55)
at com.intellij.serviceContainer.ServiceComponentAdapter.doCreateInstance(ServiceComponentAdapter.kt:41)
at com.intellij.serviceContainer.BaseComponentAdapter.getInstanceUncached(BaseComponentAdapter.kt:119)
at com.intellij.serviceContainer.BaseComponentAdapter.getInstance(BaseComponentAdapter.kt:73)
at com.intellij.serviceContainer.BaseComponentAdapter.getInstance$default(BaseComponentAdapter.kt:66)
at com.intellij.serviceContainer.ComponentManagerImpl.doGetService(ComponentManagerImpl.kt:609)
at com.intellij.serviceContainer.ComponentManagerImpl.getService(ComponentManagerImpl.kt:583)
at com.intellij.openapi.client.ClientAwareComponentManager.getFromSelfOrCurrentSession(ClientAwareComponentManager.kt:37)
at com.intellij.openapi.client.ClientAwareComponentManager.getService(ClientAwareComponentManager.kt:22)
at com.intellij.openapi.fileTypes.FileTypeManager.getInstance(FileTypeManager.java:36)
at com.intellij.openapi.fileTypes.impl.IgnoredFileCacheCleaner.beforeConnectionClosed(IgnoredFileCacheCleaner.java:10)
at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl.disconnect(PersistentFSImpl.java:114)
at com.intellij.openapi.util.ShutDownTracker.run(ShutDownTracker.java:46)
at java.base/java.lang.Thread.run(Thread.java:829)
To me, it looks like BasePlatformTestCase setup started to fail for some reason.
Any help will be appreciated.
Plugin: https://github.com/Pr1st0n/cflint-intellij/tree/next
Please sign in to leave a comment.
Hi Filipp,
Please take a look at the Incompatible API Changes docs:
https://plugins.jetbrains.com/docs/intellij/api-changes-list.html
Maybe there is something that will explain the broken build.
If not, please provide more details - what is the old and updated platform version? Maybe there is a pushed branch with all the changes?
Hi Karol,
Thanks for your reply.
Unfortunately, I did not find any API changes which could be relevant to my plugin.
The latest working version of the plugin is in the main branch
Tests are broken in the next branch. More specifically this change-set broke the tests.
platformVersion was updated from 2020.3.4 to 2022.2.2 (first tried 2021.3.3)
The tests are failing in CI unconditionally. But when I run a single test directly in IntelliJ IDEA, it only fails on the first run. Repetitive execution of a single test is always successful.
Update: repetitive tests execution does not succeed any more after I set org.gradle.unsafe.configuration-cache to false in gradle.properties