From b010ac99aceb4ca88628e99e7f7dcf1db84e4965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenzo=20Dematt=C3=A9?= Date: Tue, 18 Nov 2025 08:31:35 +0100 Subject: [PATCH] FIX: return builtin CuVSProvider when mock is null in internalClusterTests (#138155) In #137126 we refactored GPUSupport to use static initialization. Some IT tests were fixed to support this, but we did not notice that GPUIndexIT needed attention too. GPUIndexIT uses the real (builtin) CuVSProvider, and thus does not need to provide a mock. This PR changes the Test CuVSProvider to "bypass" itself when we do no specify a mock, so that in those cases we use the builtin provider. --- .../org/elasticsearch/plugin/gpu/TestCuVSServiceProvider.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/x-pack/plugin/gpu/src/internalClusterTest/java/org/elasticsearch/plugin/gpu/TestCuVSServiceProvider.java b/x-pack/plugin/gpu/src/internalClusterTest/java/org/elasticsearch/plugin/gpu/TestCuVSServiceProvider.java index fa386bffbe3cb..efa95608c8266 100644 --- a/x-pack/plugin/gpu/src/internalClusterTest/java/org/elasticsearch/plugin/gpu/TestCuVSServiceProvider.java +++ b/x-pack/plugin/gpu/src/internalClusterTest/java/org/elasticsearch/plugin/gpu/TestCuVSServiceProvider.java @@ -25,6 +25,9 @@ public class TestCuVSServiceProvider extends CuVSServiceProvider { @Override public CuVSProvider get(CuVSProvider builtin) { + if (mockedGPUInfoProvider == null) { + return builtin; + } return new CuVSProviderDelegate(builtin) { @Override public GPUInfoProvider gpuInfoProvider() {