Skip to content

Commit 8f22e28

Browse files
committed
Fix initialization of DatasetUtilTests to avoid instance check if unsupported
1 parent 949f8af commit 8f22e28

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

x-pack/plugin/gpu/src/test/java/org/elasticsearch/xpack/gpu/codec/DatasetUtilsTests.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,19 @@
2222

2323
public class DatasetUtilsTests extends ESTestCase {
2424

25+
DatasetUtils datasetUtils;
26+
2527
@Before
2628
public void setup() { // TODO: abstract out setup in to common GPUTestcase
2729
assumeTrue("cuvs runtime only supported on 22 or greater, your JDK is " + Runtime.version(), Runtime.version().feature() >= 22);
2830
try (var resources = GPUVectorsFormat.cuVSResourcesOrNull(false)) {
2931
assumeTrue("cuvs not supported", resources != null);
3032
}
33+
datasetUtils = DatasetUtils.getInstance();
3134
}
3235

3336
static final ValueLayout.OfFloat JAVA_FLOAT_LE = ValueLayout.JAVA_FLOAT_UNALIGNED.withOrder(ByteOrder.LITTLE_ENDIAN);
3437

35-
final DatasetUtils datasetUtils = DatasetUtils.getInstance();
36-
3738
public void testBasic() throws Exception {
3839
try (Directory dir = new MMapDirectory(createTempDir("testBasic"))) {
3940
int numVecs = randomIntBetween(1, 100);

0 commit comments

Comments
 (0)