From a71548da843301ce6ae6cbd6417da13dfe492cf8 Mon Sep 17 00:00:00 2001 From: Bas Leijdekkers Date: Mon, 8 Dec 2025 14:32:53 +0100 Subject: [PATCH] IDEA-357036 [java] proper property test fix by Konstantin Nisht GitOrigin-RevId: eacbfec5f35ebb37d7d6ada7c76f245117e472e5 --- .../intellij/java/propertyBased/UnivocityTest.java | 2 -- .../openapi/vcs/changes/ChangeListScheduler.kt | 11 +++++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/java/java-tests/testSrc/com/intellij/java/propertyBased/UnivocityTest.java b/java/java-tests/testSrc/com/intellij/java/propertyBased/UnivocityTest.java index 6391f09e6c06..60b2ea140fce 100644 --- a/java/java-tests/testSrc/com/intellij/java/propertyBased/UnivocityTest.java +++ b/java/java-tests/testSrc/com/intellij/java/propertyBased/UnivocityTest.java @@ -9,7 +9,6 @@ import com.intellij.openapi.project.ex.ProjectEx; import com.intellij.openapi.roots.ModuleRootManager; import com.intellij.openapi.util.Disposer; import com.intellij.openapi.util.RecursionManager; -import com.intellij.openapi.util.registry.Registry; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vfs.VfsUtil; import com.intellij.psi.*; @@ -38,7 +37,6 @@ public class UnivocityTest extends BaseUnivocityTest { super.setUp(); ((PsiDocumentManagerImpl)PsiDocumentManager.getInstance(myProject)).disableBackgroundCommit(getTestRootDisposable()); MadTestingUtil.enableAllInspections(myProject, JavaLanguage.INSTANCE, "GrazieInspection", "GrazieStyle"); - Registry.get("ruby.vcs.use.project.sdk").setValue(false, getTestRootDisposable()); } @Override diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListScheduler.kt b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListScheduler.kt index f04f5a107ae9..4e2c0e597269 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListScheduler.kt +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListScheduler.kt @@ -1,7 +1,8 @@ -// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.openapi.vcs.changes import com.intellij.openapi.application.ApplicationManager +import com.intellij.openapi.application.impl.TestOnlyThreading import com.intellij.util.lang.CompoundRuntimeException import com.intellij.util.ui.EDT import kotlinx.coroutines.* @@ -77,12 +78,14 @@ internal class ChangeListScheduler(private val coroutineScope: CoroutineScope) { EDT.dispatchAllInvocationEvents() } try { - future!!.asCompletableFuture().get(10, TimeUnit.MILLISECONDS) + TestOnlyThreading.releaseTheAcquiredWriteIntentLockThenExecuteActionAndTakeWriteIntentLockBack { + future.asCompletableFuture().get(10, TimeUnit.MILLISECONDS) + } } - catch (ignore: TimeoutException) { + catch (_: TimeoutException) { continue } - catch (ignored: CancellationException) { + catch (_: CancellationException) { } catch (e: InterruptedException) { throwables.add(e)