This is an automated email from the ASF dual-hosted git repository.

mapohl pushed a commit to branch release-1.18
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/release-1.18 by this push:
     new 3813eaf65a3 [FLINK-27082][ci] Adds a github-actions profile that 
disables certain tests that do not run in GHA
3813eaf65a3 is described below

commit 3813eaf65a3dc20b15509b93a3efd3550ebc949f
Author: Matthias Pohl <[email protected]>
AuthorDate: Fri Dec 8 17:07:44 2023 +0100

    [FLINK-27082][ci] Adds a github-actions profile that disables certain tests 
that do not run in GHA
    
    The Docker setup for GitHub Actions is run with root permissions. Any 
limitations on files are ignored because root is allowed to do anything. We 
haven't discovered, yet, why this works in Azure CI.
---
 .../flink/core/fs/local/LocalFileSystemTest.java   |  3 +++
 .../java/org/apache/flink/util/FileUtilsTest.java  |  8 +++++--
 .../webmonitor/handlers/JarDeleteHandlerTest.java  |  2 ++
 .../flink/runtime/blob/BlobCacheDeleteTest.java    |  4 ++++
 .../flink/runtime/blob/BlobCacheGetTest.java       | 10 +++++++++
 .../flink/runtime/blob/BlobCachePutTest.java       | 11 +++++++++
 .../flink/runtime/blob/BlobServerDeleteTest.java   |  5 +++++
 .../flink/runtime/blob/BlobServerGetTest.java      |  4 ++++
 .../flink/runtime/blob/BlobServerPutTest.java      | 11 +++++++++
 .../runtime/blob/BlobUtilsNonWritableTest.java     |  3 +++
 .../librarycache/BlobLibraryCacheManagerTest.java  |  3 +++
 .../flink/runtime/rest/RestServerEndpointTest.java |  3 +++
 .../FsCheckpointStateOutputStreamTest.java         |  3 +++
 .../taskexecutor/TaskManagerRunnerStartupTest.java |  2 ++
 .../state/RocksDBStateBackendConfigTest.java       |  3 +++
 .../flink/table/catalog/FileCatalogStoreTest.java  |  2 ++
 .../junit/FailsInGHAContainerWithRootUser.java     | 26 ++++++++++++++++++++++
 .../jobmaster/JobMasterTriggerSavepointITCase.java |  3 +++
 pom.xml                                            | 18 +++++++++++++++
 19 files changed, 122 insertions(+), 2 deletions(-)

diff --git 
a/flink-core/src/test/java/org/apache/flink/core/fs/local/LocalFileSystemTest.java
 
b/flink-core/src/test/java/org/apache/flink/core/fs/local/LocalFileSystemTest.java
index ca7cd5ce7bb..32366547ae6 100644
--- 
a/flink-core/src/test/java/org/apache/flink/core/fs/local/LocalFileSystemTest.java
+++ 
b/flink-core/src/test/java/org/apache/flink/core/fs/local/LocalFileSystemTest.java
@@ -25,6 +25,7 @@ import org.apache.flink.core.fs.FileSystem;
 import org.apache.flink.core.fs.FileSystem.WriteMode;
 import org.apache.flink.core.fs.FileSystemKind;
 import org.apache.flink.core.fs.Path;
+import org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser;
 import org.apache.flink.util.ExecutorUtils;
 import org.apache.flink.util.TestLogger;
 import org.apache.flink.util.function.ThrowingConsumer;
@@ -33,6 +34,7 @@ import org.apache.commons.lang3.RandomStringUtils;
 import org.junit.Assume;
 import org.junit.Rule;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 import org.junit.rules.TemporaryFolder;
 
 import java.io.File;
@@ -236,6 +238,7 @@ public class LocalFileSystemTest extends TestLogger {
     }
 
     @Test
+    @Category(FailsInGHAContainerWithRootUser.class)
     public void testRenameFileWithNoAccess() throws IOException {
         final FileSystem fs = FileSystem.getLocalFileSystem();
 
diff --git a/flink-core/src/test/java/org/apache/flink/util/FileUtilsTest.java 
b/flink-core/src/test/java/org/apache/flink/util/FileUtilsTest.java
index b24179b6f67..afd1b70c941 100644
--- a/flink-core/src/test/java/org/apache/flink/util/FileUtilsTest.java
+++ b/flink-core/src/test/java/org/apache/flink/util/FileUtilsTest.java
@@ -24,6 +24,7 @@ import org.apache.flink.core.fs.Path;
 import org.apache.flink.core.testutils.CheckedThread;
 import org.apache.flink.testutils.junit.utils.TempDirUtils;
 
+import org.junit.jupiter.api.Tag;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
 import org.junit.jupiter.api.io.TempDir;
@@ -120,13 +121,16 @@ public class FileUtilsTest {
     }
 
     @Test
-    void testDeleteDirectory() throws Exception {
-
+    void testDeleteNonExistentDirectory() throws Exception {
         // deleting a non-existent file should not cause an error
 
         File doesNotExist = TempDirUtils.newFolder(temporaryFolder, "abc");
         FileUtils.deleteDirectory(doesNotExist);
+    }
 
+    @Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
+    @Test
+    void testDeleteProtectedDirectory() throws Exception {
         // deleting a write protected file should throw an error
 
         File cannotDeleteParent = TempDirUtils.newFolder(temporaryFolder);
diff --git 
a/flink-runtime-web/src/test/java/org/apache/flink/runtime/webmonitor/handlers/JarDeleteHandlerTest.java
 
b/flink-runtime-web/src/test/java/org/apache/flink/runtime/webmonitor/handlers/JarDeleteHandlerTest.java
index a2cb10960e2..2c6b5af05f5 100644
--- 
a/flink-runtime-web/src/test/java/org/apache/flink/runtime/webmonitor/handlers/JarDeleteHandlerTest.java
+++ 
b/flink-runtime-web/src/test/java/org/apache/flink/runtime/webmonitor/handlers/JarDeleteHandlerTest.java
@@ -32,6 +32,7 @@ import 
org.apache.flink.shaded.netty4.io.netty.handler.codec.http.HttpResponseSt
 
 import org.junit.jupiter.api.Assumptions;
 import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Tag;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.io.TempDir;
 
@@ -103,6 +104,7 @@ class JarDeleteHandlerTest {
                         });
     }
 
+    @Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
     @Test
     void testFailedDelete() throws Exception {
         makeJarDirReadOnly();
diff --git 
a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheDeleteTest.java
 
b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheDeleteTest.java
index a47e98579ed..9767cd71e45 100644
--- 
a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheDeleteTest.java
+++ 
b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheDeleteTest.java
@@ -20,6 +20,7 @@ package org.apache.flink.runtime.blob;
 
 import org.apache.flink.api.common.JobID;
 import org.apache.flink.configuration.Configuration;
+import org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser;
 import org.apache.flink.util.FlinkException;
 import org.apache.flink.util.OperatingSystem;
 import org.apache.flink.util.TestLogger;
@@ -27,6 +28,7 @@ import org.apache.flink.util.concurrent.FutureUtils;
 
 import org.junit.Rule;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 import org.junit.rules.TemporaryFolder;
 
 import javax.annotation.Nullable;
@@ -210,11 +212,13 @@ public class BlobCacheDeleteTest extends TestLogger {
         }
     }
 
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testDeleteTransientLocalFailsNoJob() throws IOException, 
InterruptedException {
         testDeleteTransientLocalFails(null);
     }
 
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testDeleteTransientLocalFailsForJob() throws IOException, 
InterruptedException {
         testDeleteTransientLocalFails(new JobID());
diff --git 
a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheGetTest.java
 
b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheGetTest.java
index 513011c9505..de04a195e4d 100644
--- 
a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheGetTest.java
+++ 
b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheGetTest.java
@@ -20,6 +20,7 @@ package org.apache.flink.runtime.blob;
 
 import org.apache.flink.api.common.JobID;
 import org.apache.flink.configuration.Configuration;
+import org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser;
 import org.apache.flink.util.FlinkException;
 import org.apache.flink.util.OperatingSystem;
 import org.apache.flink.util.TestLogger;
@@ -28,6 +29,7 @@ import org.apache.flink.util.concurrent.FutureUtils;
 import org.apache.commons.lang3.exception.ExceptionUtils;
 import org.junit.Rule;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 import org.junit.rules.ExpectedException;
 import org.junit.rules.TemporaryFolder;
 
@@ -186,16 +188,19 @@ public class BlobCacheGetTest extends TestLogger {
         }
     }
 
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testGetFailsIncomingNoJob() throws IOException {
         testGetFailsIncoming(null, TRANSIENT_BLOB);
     }
 
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testGetFailsIncomingForJob() throws IOException {
         testGetFailsIncoming(new JobID(), TRANSIENT_BLOB);
     }
 
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testGetFailsIncomingForJobHa() throws IOException {
         testGetFailsIncoming(new JobID(), PERMANENT_BLOB);
@@ -288,16 +293,19 @@ public class BlobCacheGetTest extends TestLogger {
         }
     }
 
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testGetTransientFailsStoreNoJob() throws IOException, 
InterruptedException {
         testGetFailsStore(null, TRANSIENT_BLOB);
     }
 
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testGetTransientFailsStoreForJob() throws IOException, 
InterruptedException {
         testGetFailsStore(new JobID(), TRANSIENT_BLOB);
     }
 
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testGetPermanentFailsStoreForJob() throws IOException, 
InterruptedException {
         testGetFailsStore(new JobID(), PERMANENT_BLOB);
@@ -430,11 +438,13 @@ public class BlobCacheGetTest extends TestLogger {
         }
     }
 
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testGetTransientRemoteDeleteFailsNoJob() throws IOException {
         testGetTransientRemoteDeleteFails(null);
     }
 
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testGetTransientRemoteDeleteFailsForJob() throws IOException {
         testGetTransientRemoteDeleteFails(new JobID());
diff --git 
a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCachePutTest.java
 
b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCachePutTest.java
index f5cb95da84a..ca9bd102774 100644
--- 
a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCachePutTest.java
+++ 
b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCachePutTest.java
@@ -22,6 +22,7 @@ import org.apache.flink.api.common.JobID;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.core.fs.Path;
 import org.apache.flink.core.testutils.CheckedThread;
+import org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser;
 import org.apache.flink.util.FlinkException;
 import org.apache.flink.util.OperatingSystem;
 import org.apache.flink.util.TestLogger;
@@ -30,6 +31,7 @@ import org.apache.flink.util.concurrent.FutureUtils;
 import org.apache.commons.io.FileUtils;
 import org.junit.Rule;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 import org.junit.rules.ExpectedException;
 import org.junit.rules.TemporaryFolder;
 
@@ -558,16 +560,19 @@ public class BlobCachePutTest extends TestLogger {
 
     // 
--------------------------------------------------------------------------------------------
 
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testPutBufferFailsNoJob() throws IOException {
         testPutBufferFails(null, TRANSIENT_BLOB);
     }
 
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testPutBufferFailsForJob() throws IOException {
         testPutBufferFails(new JobID(), TRANSIENT_BLOB);
     }
 
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testPutBufferFailsForJobHa() throws IOException {
         testPutBufferFails(new JobID(), PERMANENT_BLOB);
@@ -621,16 +626,19 @@ public class BlobCachePutTest extends TestLogger {
         }
     }
 
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testPutBufferFailsIncomingNoJob() throws IOException {
         testPutBufferFailsIncoming(null, TRANSIENT_BLOB);
     }
 
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testPutBufferFailsIncomingForJob() throws IOException {
         testPutBufferFailsIncoming(new JobID(), TRANSIENT_BLOB);
     }
 
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testPutBufferFailsIncomingForJobHa() throws IOException {
         testPutBufferFailsIncoming(new JobID(), PERMANENT_BLOB);
@@ -689,16 +697,19 @@ public class BlobCachePutTest extends TestLogger {
         }
     }
 
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testPutBufferFailsStoreNoJob() throws IOException {
         testPutBufferFailsStore(null, TRANSIENT_BLOB);
     }
 
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testPutBufferFailsStoreForJob() throws IOException {
         testPutBufferFailsStore(new JobID(), TRANSIENT_BLOB);
     }
 
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testPutBufferFailsStoreForJobHa() throws IOException {
         testPutBufferFailsStore(new JobID(), PERMANENT_BLOB);
diff --git 
a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerDeleteTest.java
 
b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerDeleteTest.java
index 91ad3ff2338..9011d3d83f0 100644
--- 
a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerDeleteTest.java
+++ 
b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerDeleteTest.java
@@ -20,6 +20,7 @@ package org.apache.flink.runtime.blob;
 
 import org.apache.flink.api.common.JobID;
 import org.apache.flink.configuration.Configuration;
+import org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser;
 import org.apache.flink.util.FlinkException;
 import org.apache.flink.util.OperatingSystem;
 import org.apache.flink.util.Preconditions;
@@ -29,6 +30,7 @@ import org.apache.flink.util.concurrent.FutureUtils;
 import org.hamcrest.collection.IsEmptyCollection;
 import org.junit.Rule;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 import org.junit.rules.TemporaryFolder;
 
 import javax.annotation.Nullable;
@@ -203,16 +205,19 @@ public class BlobServerDeleteTest extends TestLogger {
         }
     }
 
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testDeleteTransientFailsNoJob() throws IOException {
         testDeleteBlobFails(null, TRANSIENT_BLOB);
     }
 
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testDeleteTransientFailsForJob() throws IOException {
         testDeleteBlobFails(new JobID(), TRANSIENT_BLOB);
     }
 
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testDeletePermanentFailsForJob() throws IOException {
         testDeleteBlobFails(new JobID(), PERMANENT_BLOB);
diff --git 
a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerGetTest.java
 
b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerGetTest.java
index 9ff57281226..b2a45391ef6 100644
--- 
a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerGetTest.java
+++ 
b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerGetTest.java
@@ -23,6 +23,7 @@ import org.apache.flink.configuration.Configuration;
 import org.apache.flink.configuration.HighAvailabilityOptions;
 import org.apache.flink.core.testutils.FlinkAssertions;
 import org.apache.flink.core.testutils.OneShotLatch;
+import org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser;
 import org.apache.flink.util.FlinkException;
 import org.apache.flink.util.OperatingSystem;
 import org.apache.flink.util.Reference;
@@ -32,6 +33,7 @@ import org.apache.flink.util.concurrent.FutureUtils;
 import org.apache.commons.io.FileUtils;
 import org.junit.Rule;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 import org.junit.rules.TemporaryFolder;
 
 import javax.annotation.Nullable;
@@ -153,6 +155,7 @@ public class BlobServerGetTest extends TestLogger {
      * Retrieves a BLOB from the HA store to a {@link BlobServer} which cannot 
create incoming
      * files. File transfers should fail.
      */
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testGetFailsIncomingForJobHa() throws IOException {
         assumeTrue(!OperatingSystem.isWindows()); // setWritable doesn't work 
on Windows.
@@ -225,6 +228,7 @@ public class BlobServerGetTest extends TestLogger {
      * Retrieves a BLOB from the HA store to a {@link BlobServer} which cannot 
create the final
      * storage file. File transfers should fail.
      */
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testGetFailsStoreForJobHa() throws IOException {
         assumeTrue(!OperatingSystem.isWindows()); // setWritable doesn't work 
on Windows.
diff --git 
a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerPutTest.java
 
b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerPutTest.java
index e3154c56ebd..4e618f3faf1 100644
--- 
a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerPutTest.java
+++ 
b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobServerPutTest.java
@@ -22,6 +22,7 @@ import org.apache.flink.api.common.JobID;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.core.fs.Path;
 import org.apache.flink.core.testutils.CheckedThread;
+import org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser;
 import org.apache.flink.util.FlinkException;
 import org.apache.flink.util.OperatingSystem;
 import org.apache.flink.util.Preconditions;
@@ -31,6 +32,7 @@ import org.apache.flink.util.concurrent.FutureUtils;
 import org.apache.commons.io.FileUtils;
 import org.junit.Rule;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 import org.junit.rules.ExpectedException;
 import org.junit.rules.TemporaryFolder;
 
@@ -426,16 +428,19 @@ public class BlobServerPutTest extends TestLogger {
 
     // 
--------------------------------------------------------------------------------------------
 
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testPutBufferFailsNoJob() throws IOException {
         testPutBufferFails(null, TRANSIENT_BLOB);
     }
 
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testPutBufferFailsForJob() throws IOException {
         testPutBufferFails(new JobID(), TRANSIENT_BLOB);
     }
 
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testPutBufferFailsForJobHa() throws IOException {
         testPutBufferFails(new JobID(), PERMANENT_BLOB);
@@ -483,16 +488,19 @@ public class BlobServerPutTest extends TestLogger {
         }
     }
 
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testPutBufferFailsIncomingNoJob() throws IOException {
         testPutBufferFailsIncoming(null, TRANSIENT_BLOB);
     }
 
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testPutBufferFailsIncomingForJob() throws IOException {
         testPutBufferFailsIncoming(new JobID(), TRANSIENT_BLOB);
     }
 
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testPutBufferFailsIncomingForJobHa() throws IOException {
         testPutBufferFailsIncoming(new JobID(), PERMANENT_BLOB);
@@ -546,16 +554,19 @@ public class BlobServerPutTest extends TestLogger {
         }
     }
 
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testPutBufferFailsStoreNoJob() throws IOException {
         testPutBufferFailsStore(null, TRANSIENT_BLOB);
     }
 
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testPutBufferFailsStoreForJob() throws IOException {
         testPutBufferFailsStore(new JobID(), TRANSIENT_BLOB);
     }
 
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testPutBufferFailsStoreForJobHa() throws IOException {
         testPutBufferFailsStore(new JobID(), PERMANENT_BLOB);
diff --git 
a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobUtilsNonWritableTest.java
 
b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobUtilsNonWritableTest.java
index 336389866aa..421143b29f6 100644
--- 
a/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobUtilsNonWritableTest.java
+++ 
b/flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobUtilsNonWritableTest.java
@@ -21,6 +21,7 @@ package org.apache.flink.runtime.blob;
 import org.apache.flink.api.common.JobID;
 import org.apache.flink.configuration.BlobServerOptions;
 import org.apache.flink.configuration.Configuration;
+import org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser;
 import org.apache.flink.util.OperatingSystem;
 import org.apache.flink.util.TestLogger;
 
@@ -28,6 +29,7 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 import org.junit.rules.TemporaryFolder;
 
 import java.io.File;
@@ -37,6 +39,7 @@ import static org.junit.Assert.assertTrue;
 import static org.junit.Assume.assumeTrue;
 
 /** Tests for {@link BlobUtils} working on non-writable directories. */
+@Category(FailsInGHAContainerWithRootUser.class)
 public class BlobUtilsNonWritableTest extends TestLogger {
 
     private static final String CANNOT_CREATE_THIS = "cannot-create-this";
diff --git 
a/flink-runtime/src/test/java/org/apache/flink/runtime/execution/librarycache/BlobLibraryCacheManagerTest.java
 
b/flink-runtime/src/test/java/org/apache/flink/runtime/execution/librarycache/BlobLibraryCacheManagerTest.java
index dda0e2a9580..b38af96226a 100644
--- 
a/flink-runtime/src/test/java/org/apache/flink/runtime/execution/librarycache/BlobLibraryCacheManagerTest.java
+++ 
b/flink-runtime/src/test/java/org/apache/flink/runtime/execution/librarycache/BlobLibraryCacheManagerTest.java
@@ -27,6 +27,7 @@ import org.apache.flink.runtime.blob.PermanentBlobCache;
 import org.apache.flink.runtime.blob.PermanentBlobKey;
 import org.apache.flink.runtime.blob.PermanentBlobService;
 import org.apache.flink.runtime.blob.VoidBlobStore;
+import org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser;
 import org.apache.flink.util.FlinkUserCodeClassLoaders;
 import org.apache.flink.util.OperatingSystem;
 import org.apache.flink.util.TestLogger;
@@ -34,6 +35,7 @@ import org.apache.flink.util.UserCodeClassLoader;
 
 import org.junit.Rule;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 import org.junit.rules.TemporaryFolder;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -323,6 +325,7 @@ public class BlobLibraryCacheManagerTest extends TestLogger 
{
     }
 
     @Test
+    @Category(FailsInGHAContainerWithRootUser.class)
     public void testRegisterAndDownload() throws IOException {
         assumeTrue(!OperatingSystem.isWindows()); // setWritable doesn't work 
on Windows.
 
diff --git 
a/flink-runtime/src/test/java/org/apache/flink/runtime/rest/RestServerEndpointTest.java
 
b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/RestServerEndpointTest.java
index 8ff85020c25..3d8ea2cd7a9 100644
--- 
a/flink-runtime/src/test/java/org/apache/flink/runtime/rest/RestServerEndpointTest.java
+++ 
b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/RestServerEndpointTest.java
@@ -18,11 +18,13 @@
 
 package org.apache.flink.runtime.rest;
 
+import org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser;
 import org.apache.flink.util.TestLogger;
 
 import org.junit.Assume;
 import org.junit.Rule;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 import org.junit.rules.TemporaryFolder;
 import org.slf4j.helpers.NOPLogger;
 
@@ -81,6 +83,7 @@ public class RestServerEndpointTest extends TestLogger {
         assertTrue(Files.exists(testUploadDir));
     }
 
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testCreateUploadDirFails() throws Exception {
         final File file = temporaryFolder.newFolder();
diff --git 
a/flink-runtime/src/test/java/org/apache/flink/runtime/state/filesystem/FsCheckpointStateOutputStreamTest.java
 
b/flink-runtime/src/test/java/org/apache/flink/runtime/state/filesystem/FsCheckpointStateOutputStreamTest.java
index 472c35c4137..eb09aff858b 100644
--- 
a/flink-runtime/src/test/java/org/apache/flink/runtime/state/filesystem/FsCheckpointStateOutputStreamTest.java
+++ 
b/flink-runtime/src/test/java/org/apache/flink/runtime/state/filesystem/FsCheckpointStateOutputStreamTest.java
@@ -26,10 +26,12 @@ import 
org.apache.flink.runtime.state.CheckpointStateOutputStream;
 import org.apache.flink.runtime.state.StreamStateHandle;
 import 
org.apache.flink.runtime.state.filesystem.FsCheckpointStreamFactory.FsCheckpointStateOutputStream;
 import org.apache.flink.runtime.state.memory.ByteStreamStateHandle;
+import org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser;
 
 import org.junit.Assert;
 import org.junit.Rule;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 import org.junit.rules.TemporaryFolder;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -376,6 +378,7 @@ public class FsCheckpointStateOutputStreamTest {
      * This test checks that the stream does not check and clean the parent 
directory when
      * encountering a write error.
      */
+    @Category(FailsInGHAContainerWithRootUser.class)
     @Test
     public void testStreamDoesNotTryToCleanUpParentOnError() throws Exception {
         final File directory = tempDir.newFolder();
diff --git 
a/flink-runtime/src/test/java/org/apache/flink/runtime/taskexecutor/TaskManagerRunnerStartupTest.java
 
b/flink-runtime/src/test/java/org/apache/flink/runtime/taskexecutor/TaskManagerRunnerStartupTest.java
index 6b98b5cd202..11f7d707f94 100644
--- 
a/flink-runtime/src/test/java/org/apache/flink/runtime/taskexecutor/TaskManagerRunnerStartupTest.java
+++ 
b/flink-runtime/src/test/java/org/apache/flink/runtime/taskexecutor/TaskManagerRunnerStartupTest.java
@@ -50,6 +50,7 @@ import org.apache.commons.io.FileUtils;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.Assumptions;
 import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Tag;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.io.TempDir;
@@ -113,6 +114,7 @@ class TaskManagerRunnerStartupTest {
      * Tests that the TaskManagerRunner startup fails synchronously when the 
I/O directories are not
      * writable.
      */
+    @Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
     @Test
     void testIODirectoryNotWritable() throws Exception {
         File nonWritable = TempDirUtils.newFolder(tempFolder);
diff --git 
a/flink-state-backends/flink-statebackend-rocksdb/src/test/java/org/apache/flink/contrib/streaming/state/RocksDBStateBackendConfigTest.java
 
b/flink-state-backends/flink-statebackend-rocksdb/src/test/java/org/apache/flink/contrib/streaming/state/RocksDBStateBackendConfigTest.java
index 36e0d3c2bce..51195452d0f 100644
--- 
a/flink-state-backends/flink-statebackend-rocksdb/src/test/java/org/apache/flink/contrib/streaming/state/RocksDBStateBackendConfigTest.java
+++ 
b/flink-state-backends/flink-statebackend-rocksdb/src/test/java/org/apache/flink/contrib/streaming/state/RocksDBStateBackendConfigTest.java
@@ -42,12 +42,14 @@ import 
org.apache.flink.runtime.state.heap.HeapPriorityQueueSetFactory;
 import org.apache.flink.runtime.state.memory.MemoryStateBackend;
 import org.apache.flink.runtime.state.ttl.TtlTimeProvider;
 import org.apache.flink.runtime.util.TestingTaskManagerRuntimeInfo;
+import org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser;
 import org.apache.flink.util.IOUtils;
 
 import org.junit.Assert;
 import org.junit.Assume;
 import org.junit.Rule;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 import org.junit.rules.TemporaryFolder;
 import org.rocksdb.BlockBasedTableConfig;
 import org.rocksdb.BloomFilter;
@@ -379,6 +381,7 @@ public class RocksDBStateBackendConfigTest {
     // ------------------------------------------------------------------------
 
     @Test
+    @Category(FailsInGHAContainerWithRootUser.class)
     public void testFailWhenNoLocalStorageDir() throws Exception {
         final File targetDir = tempFolder.newFolder();
         Assume.assumeTrue(
diff --git 
a/flink-table/flink-table-api-java/src/test/java/org/apache/flink/table/catalog/FileCatalogStoreTest.java
 
b/flink-table/flink-table-api-java/src/test/java/org/apache/flink/table/catalog/FileCatalogStoreTest.java
index 011ce881bb8..2824605fd62 100644
--- 
a/flink-table/flink-table-api-java/src/test/java/org/apache/flink/table/catalog/FileCatalogStoreTest.java
+++ 
b/flink-table/flink-table-api-java/src/test/java/org/apache/flink/table/catalog/FileCatalogStoreTest.java
@@ -23,6 +23,7 @@ import 
org.apache.flink.table.catalog.exceptions.CatalogException;
 import org.apache.flink.util.OperatingSystem;
 
 import org.assertj.core.api.ThrowableAssert;
+import org.junit.jupiter.api.Tag;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.io.TempDir;
 
@@ -63,6 +64,7 @@ class FileCatalogStoreTest {
         assertCatalogStoreNotOpened(() -> catalogStore.removeCatalog(DUMMY, 
true));
     }
 
+    @Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
     @Test
     void testCannotMakeStorePath() {
         assumeThat(OperatingSystem.isWindows())
diff --git 
a/flink-test-utils-parent/flink-test-utils-junit/src/main/java/org/apache/flink/testutils/junit/FailsInGHAContainerWithRootUser.java
 
b/flink-test-utils-parent/flink-test-utils-junit/src/main/java/org/apache/flink/testutils/junit/FailsInGHAContainerWithRootUser.java
new file mode 100644
index 00000000000..47ebd03fe7f
--- /dev/null
+++ 
b/flink-test-utils-parent/flink-test-utils-junit/src/main/java/org/apache/flink/testutils/junit/FailsInGHAContainerWithRootUser.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.testutils.junit;
+
+/**
+ * Collects tests that fail in GitHub Actions workflows that execute the tests 
in containers as a
+ * root user.
+ *
+ * <p>See FLINK-27082/FLINK-33903
+ */
+public interface FailsInGHAContainerWithRootUser {}
diff --git 
a/flink-tests/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterTriggerSavepointITCase.java
 
b/flink-tests/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterTriggerSavepointITCase.java
index ac0c94adce5..01ea0a83d9e 100644
--- 
a/flink-tests/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterTriggerSavepointITCase.java
+++ 
b/flink-tests/src/test/java/org/apache/flink/runtime/jobmaster/JobMasterTriggerSavepointITCase.java
@@ -38,11 +38,13 @@ import 
org.apache.flink.runtime.jobgraph.tasks.AbstractInvokable;
 import 
org.apache.flink.runtime.jobgraph.tasks.CheckpointCoordinatorConfiguration;
 import org.apache.flink.runtime.jobgraph.tasks.JobCheckpointingSettings;
 import org.apache.flink.test.util.AbstractTestBase;
+import org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser;
 import org.apache.flink.util.ExceptionUtils;
 
 import org.junit.Assume;
 import org.junit.Rule;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 import org.junit.rules.TemporaryFolder;
 
 import java.io.IOException;
@@ -158,6 +160,7 @@ public class JobMasterTriggerSavepointITCase extends 
AbstractTestBase {
     }
 
     @Test
+    @Category(FailsInGHAContainerWithRootUser.class)
     public void testDoNotCancelJobIfSavepointFails() throws Exception {
         setUpWithCheckpointInterval(10L);
 
diff --git a/pom.xml b/pom.xml
index 603e4532f54..ee19b031b15 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1016,6 +1016,24 @@ under the License.
                        </build>
                </profile>
 
+               <profile>
+                       <id>github-actions</id>
+
+                       <build>
+                               <pluginManagement>
+                                       <plugins>
+                                               <plugin>
+                                                       
<groupId>org.apache.maven.plugins</groupId>
+                                                       
<artifactId>maven-surefire-plugin</artifactId>
+                                                       <configuration>
+                                                               
<excludedGroups>org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser</excludedGroups>
+                                                       </configuration>
+                                               </plugin>
+                                       </plugins>
+                               </pluginManagement>
+                       </build>
+               </profile>
+
                <profile>
                        <id>java11</id>
                        <activation>

Reply via email to