do not execute preallocate tests on encrypted storage (#111627)

This commit is contained in:
Lorenzo Dematté 2024-08-07 17:50:12 +02:00 committed by GitHub
parent f9bf2b62a8
commit 6fc0047f23
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 6 deletions

View file

@ -9,6 +9,7 @@
package org.elasticsearch.nativeaccess; package org.elasticsearch.nativeaccess;
import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.ESTestCase;
import org.junit.Before;
import java.io.IOException; import java.io.IOException;
import java.nio.file.Path; import java.nio.file.Path;
@ -17,8 +18,14 @@ import java.util.OptionalLong;
import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.equalTo;
public class PreallocateTests extends ESTestCase { public class PreallocateTests extends ESTestCase {
public void testPreallocate() throws IOException {
@Before
public void setup() {
assumeFalse("no preallocate on windows", System.getProperty("os.name").startsWith("Windows")); assumeFalse("no preallocate on windows", System.getProperty("os.name").startsWith("Windows"));
assumeFalse("preallocate not supported on encrypted block devices", "encryption-at-rest".equals(System.getenv("BUILDKITE_LABEL")));
}
public void testPreallocate() throws IOException {
Path file = createTempFile(); Path file = createTempFile();
long size = 1024 * 1024; // 1 MB long size = 1024 * 1024; // 1 MB
var nativeAccess = NativeAccess.instance(); var nativeAccess = NativeAccess.instance();
@ -29,7 +36,6 @@ public class PreallocateTests extends ESTestCase {
} }
public void testPreallocateNonExistingFile() { public void testPreallocateNonExistingFile() {
assumeFalse("no preallocate on windows", System.getProperty("os.name").startsWith("Windows"));
Path file = createTempDir().resolve("intermediate-dir").resolve("test-preallocate"); Path file = createTempDir().resolve("intermediate-dir").resolve("test-preallocate");
long size = 1024 * 1024; // 1 MB long size = 1024 * 1024; // 1 MB
var nativeAccess = NativeAccess.instance(); var nativeAccess = NativeAccess.instance();
@ -40,7 +46,6 @@ public class PreallocateTests extends ESTestCase {
} }
public void testPreallocateNonExistingDirectory() { public void testPreallocateNonExistingDirectory() {
assumeFalse("no preallocate on windows", System.getProperty("os.name").startsWith("Windows"));
Path file = createTempDir().resolve("intermediate-dir").resolve("test-preallocate"); Path file = createTempDir().resolve("intermediate-dir").resolve("test-preallocate");
long size = 1024 * 1024; // 1 MB long size = 1024 * 1024; // 1 MB
var nativeAccess = NativeAccess.instance(); var nativeAccess = NativeAccess.instance();

View file

@ -74,9 +74,6 @@ tests:
- class: org.elasticsearch.xpack.searchablesnapshots.cache.common.CacheFileTests - class: org.elasticsearch.xpack.searchablesnapshots.cache.common.CacheFileTests
method: testCacheFileCreatedAsSparseFile method: testCacheFileCreatedAsSparseFile
issue: https://github.com/elastic/elasticsearch/issues/110801 issue: https://github.com/elastic/elasticsearch/issues/110801
- class: org.elasticsearch.nativeaccess.PreallocateTests
method: testPreallocate
issue: https://github.com/elastic/elasticsearch/issues/110948
- class: org.elasticsearch.nativeaccess.VectorSystemPropertyTests - class: org.elasticsearch.nativeaccess.VectorSystemPropertyTests
method: testSystemPropertyDisabled method: testSystemPropertyDisabled
issue: https://github.com/elastic/elasticsearch/issues/110949 issue: https://github.com/elastic/elasticsearch/issues/110949