diff --git a/platform/platform-tests/testSrc/com/intellij/util/io/storage/VFSContentStorageAdapterTest.java b/platform/platform-tests/testSrc/com/intellij/util/io/storage/VFSContentStorageAdapterTest.java index e00f7722c5ec..49d1e71b738e 100644 --- a/platform/platform-tests/testSrc/com/intellij/util/io/storage/VFSContentStorageAdapterTest.java +++ b/platform/platform-tests/testSrc/com/intellij/util/io/storage/VFSContentStorageAdapterTest.java @@ -1,11 +1,13 @@ -// Copyright 2000-2024 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.util.io.storage; import com.intellij.openapi.vfs.newvfs.persistent.dev.content.ContentHashEnumeratorOverDurableEnumerator; import com.intellij.openapi.vfs.newvfs.persistent.dev.content.ContentStorageAdapter; +import com.intellij.util.io.PageCacheUtils; import com.intellij.util.io.storage.lf.RefCountingContentStorageImplLF; import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; import java.io.IOException; import java.nio.file.Path; @@ -13,11 +15,18 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import static com.intellij.util.io.storage.CapacityAllocationPolicy.FIVE_PERCENT_FOR_GROWTH; +import static org.junit.jupiter.api.Assumptions.assumeTrue; public class VFSContentStorageAdapterTest extends VFSContentStorageTestBase { private ExecutorService storingPool; + @BeforeAll + static void checkLockFreeEnabled() { + assumeTrue(PageCacheUtils.LOCK_FREE_PAGE_CACHE_ENABLED, + "ContentHashEnumeratorOverDurableEnumerator expects lock-free FilePageCache to be enabled"); + } + @Override protected @NotNull ContentStorageAdapter openStorage(@NotNull Path storagePath) throws IOException { storingPool = Executors.newSingleThreadExecutor(r -> new Thread(r, "ContentWriting Pool")); diff --git a/platform/util/src/com/intellij/util/io/PageCacheUtils.java b/platform/util/src/com/intellij/util/io/PageCacheUtils.java index e2019541e895..7318c776dac9 100644 --- a/platform/util/src/com/intellij/util/io/PageCacheUtils.java +++ b/platform/util/src/com/intellij/util/io/PageCacheUtils.java @@ -1,4 +1,4 @@ -// 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.util.io; import com.intellij.openapi.diagnostic.Logger; @@ -46,7 +46,7 @@ public final class PageCacheUtils { * So far both new and {@link FilePageCache legacy} file caches co-exist: storages are incrementally migrated * to new cache */ - public static final boolean LOCK_FREE_PAGE_CACHE_ENABLED = getBooleanProperty("vfs.lock-free-impl.enable", true); + public static final boolean LOCK_FREE_PAGE_CACHE_ENABLED = getBooleanProperty("vfs.lock-free-impl.enable", false); /** * How much direct memory the new (code name 'lock-free') FilePageCache impl allowed to utilize: as a fraction