Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions .github/workflows/template.flink-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -247,17 +247,36 @@ jobs:
working-directory: ${{ env.CONTAINER_LOCAL_WORKING_DIR }}
run: ./tools/azure-pipelines/cache_docker_images.sh load

- name: "Create non-root user for test execution"
run: |
useradd -m -u 1001 flink
echo "flink ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
for sock in /var/run/docker.sock /run/docker.sock; do
if [ -e "$sock" ]; then
chmod 666 "$sock"
echo "Docker socket found at $sock"
fi
done
mkdir -p \
${{ env.CONTAINER_LOCAL_WORKING_DIR }} \
${{ env.CONTAINER_LOCAL_WORKING_DIR }} \
${{ env.DOCKER_IMAGES_CACHE_FOLDER }}
chown -R flink:flink ${{ env.CONTAINER_LOCAL_WORKING_DIR }}
chown -R flink:flink ${{ env.MAVEN_REPO_FOLDER }}
chown -R flink:flink ${{ env.DOCKER_IMAGES_CACHE_FOLDER }}

- name: "Test - ${{ matrix.module }}"
id: test-run
working-directory: ${{ env.CONTAINER_LOCAL_WORKING_DIR }}
env:
IT_CASE_S3_BUCKET: ${{ secrets.s3_bucket }}
IT_CASE_S3_ACCESS_KEY: ${{ secrets.s3_access_key }}
IT_CASE_S3_SECRET_KEY: ${{ secrets.s3_secret_key }}
DOCKER_HOST: unix:///var/run/docker.sock
timeout-minutes: ${{ fromJSON(env.GHA_JOB_TIMEOUT) }}
run: |
${{ inputs.environment }} PROFILE="$PROFILE -Pgithub-actions" ./tools/azure-pipelines/uploading_watchdog.sh \
./tools/ci/test_controller.sh ${{ matrix.module }}
runuser -u flink -- bash -c '${{ inputs.environment }} PROFILE="$PROFILE -Pgithub-actions" ./tools/azure-pipelines/uploading_watchdog.sh \
./tools/ci/test_controller.sh ${{ matrix.module }}'

- name: "Post-build Disk Info"
if: ${{ always() }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

import org.apache.commons.lang3.RandomStringUtils;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;

Expand Down Expand Up @@ -234,7 +233,6 @@ void testRenameNonExistingFile() throws IOException {
}

@Test
@Tag("FailsInGHAContainerWithRootUser")
@Disabled
void testRenameFileWithNoAccess() throws IOException {
final FileSystem fs = FileSystem.getLocalFileSystem();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
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.io.TempDir;

Expand Down Expand Up @@ -128,7 +127,6 @@ void testDeleteNonExistentDirectory() throws Exception {
FileUtils.deleteDirectory(doesNotExist);
}

@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testDeleteProtectedDirectory() throws Exception {
// deleting a write protected file should throw an error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

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;

Expand Down Expand Up @@ -104,7 +103,6 @@ void testDeleteUnknownJar() throws Exception {
});
}

@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testFailedDelete() throws Exception {
makeJarDirReadOnly();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.apache.flink.util.OperatingSystem;
import org.apache.flink.util.concurrent.FutureUtils;

import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;

Expand Down Expand Up @@ -194,13 +193,11 @@ private void testDeleteTransientAlreadyDeleted(@Nullable final JobID jobId) thro
}
}

@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testDeleteTransientLocalFailsNoJob() throws IOException, InterruptedException {
testDeleteTransientLocalFails(null);
}

@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testDeleteTransientLocalFailsForJob() throws IOException, InterruptedException {
testDeleteTransientLocalFails(new JobID());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import org.apache.flink.util.concurrent.FutureUtils;

import org.apache.commons.lang3.exception.ExceptionUtils;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;

Expand Down Expand Up @@ -170,19 +169,16 @@ private void testGetFailsDuringLookup(
}
}

@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testGetFailsIncomingNoJob() throws IOException {
testGetFailsIncoming(null, TRANSIENT_BLOB);
}

@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testGetFailsIncomingForJob() throws IOException {
testGetFailsIncoming(new JobID(), TRANSIENT_BLOB);
}

@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testGetFailsIncomingForJobHa() throws IOException {
testGetFailsIncoming(new JobID(), PERMANENT_BLOB);
Expand Down Expand Up @@ -268,19 +264,16 @@ private void testGetFailsIncoming(@Nullable final JobID jobId, BlobKey.BlobType
}
}

@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testGetTransientFailsStoreNoJob() throws IOException, InterruptedException {
testGetFailsStore(null, TRANSIENT_BLOB);
}

@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testGetTransientFailsStoreForJob() throws IOException, InterruptedException {
testGetFailsStore(new JobID(), TRANSIENT_BLOB);
}

@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testGetPermanentFailsStoreForJob() throws IOException, InterruptedException {
testGetFailsStore(new JobID(), PERMANENT_BLOB);
Expand Down Expand Up @@ -402,13 +395,11 @@ void testGetFailsHaStoreForJobHa() throws IOException {
}
}

@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testGetTransientRemoteDeleteFailsNoJob() throws IOException {
testGetTransientRemoteDeleteFails(null);
}

@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testGetTransientRemoteDeleteFailsForJob() throws IOException {
testGetTransientRemoteDeleteFails(new JobID());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import org.apache.flink.util.concurrent.FutureUtils;

import org.apache.commons.io.FileUtils;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;

Expand Down Expand Up @@ -521,19 +520,16 @@ private void testPutChunkedStreamTransientSuccessfulGet(

// --------------------------------------------------------------------------------------------

@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testPutBufferFailsNoJob() throws IOException {
testPutBufferFails(null, TRANSIENT_BLOB);
}

@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testPutBufferFailsForJob() throws IOException {
testPutBufferFails(new JobID(), TRANSIENT_BLOB);
}

@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testPutBufferFailsForJobHa() throws IOException {
testPutBufferFails(new JobID(), PERMANENT_BLOB);
Expand Down Expand Up @@ -574,19 +570,16 @@ private void testPutBufferFails(@Nullable final JobID jobId, BlobKey.BlobType bl
}
}

@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testPutBufferFailsIncomingNoJob() throws IOException {
testPutBufferFailsIncoming(null, TRANSIENT_BLOB);
}

@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testPutBufferFailsIncomingForJob() throws IOException {
testPutBufferFailsIncoming(new JobID(), TRANSIENT_BLOB);
}

@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testPutBufferFailsIncomingForJobHa() throws IOException {
testPutBufferFailsIncoming(new JobID(), PERMANENT_BLOB);
Expand Down Expand Up @@ -638,19 +631,16 @@ private void testPutBufferFailsIncoming(@Nullable final JobID jobId, BlobKey.Blo
}
}

@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testPutBufferFailsStoreNoJob() throws IOException {
testPutBufferFailsStore(null, TRANSIENT_BLOB);
}

@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testPutBufferFailsStoreForJob() throws IOException {
testPutBufferFailsStore(new JobID(), TRANSIENT_BLOB);
}

@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testPutBufferFailsStoreForJobHa() throws IOException {
testPutBufferFailsStore(new JobID(), PERMANENT_BLOB);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.apache.flink.util.Preconditions;
import org.apache.flink.util.concurrent.FutureUtils;

import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;

Expand Down Expand Up @@ -189,19 +188,16 @@ private void testDeleteBlobAlreadyDeleted(
}
}

@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testDeleteTransientFailsNoJob() throws IOException {
testDeleteBlobFails(null, TRANSIENT_BLOB);
}

@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testDeleteTransientFailsForJob() throws IOException {
testDeleteBlobFails(new JobID(), TRANSIENT_BLOB);
}

@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testDeletePermanentFailsForJob() throws IOException {
testDeleteBlobFails(new JobID(), PERMANENT_BLOB);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import org.apache.flink.util.concurrent.FutureUtils;

import org.apache.commons.io.FileUtils;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;

Expand Down Expand Up @@ -146,7 +145,6 @@ private void testGetFailsDuringLookup(
* Retrieves a BLOB from the HA store to a {@link BlobServer} which cannot create incoming
* files. File transfers should fail.
*/
@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testGetFailsIncomingForJobHa() throws IOException {
assumeThat(OperatingSystem.isWindows()).as("setWritable doesn't work on Windows").isFalse();
Expand Down Expand Up @@ -219,7 +217,6 @@ void testGetFailsIncomingForJobHa() throws IOException {
* Retrieves a BLOB from the HA store to a {@link BlobServer} which cannot create the final
* storage file. File transfers should fail.
*/
@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testGetFailsStoreForJobHa() throws IOException {
assumeThat(OperatingSystem.isWindows()).as("setWritable doesn't work on Windows").isFalse();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.apache.flink.util.concurrent.FutureUtils;

import org.apache.commons.io.FileUtils;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;

Expand Down Expand Up @@ -403,19 +402,16 @@ private void testPutChunkedStreamSuccessfulGet(

// --------------------------------------------------------------------------------------------

@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testPutBufferFailsNoJob() throws IOException {
testPutBufferFails(null, TRANSIENT_BLOB);
}

@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testPutBufferFailsForJob() throws IOException {
testPutBufferFails(new JobID(), TRANSIENT_BLOB);
}

@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testPutBufferFailsForJobHa() throws IOException {
testPutBufferFails(new JobID(), PERMANENT_BLOB);
Expand Down Expand Up @@ -453,19 +449,16 @@ private void testPutBufferFails(@Nullable final JobID jobId, BlobKey.BlobType bl
}
}

@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testPutBufferFailsIncomingNoJob() throws IOException {
testPutBufferFailsIncoming(null, TRANSIENT_BLOB);
}

@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testPutBufferFailsIncomingForJob() throws IOException {
testPutBufferFailsIncoming(new JobID(), TRANSIENT_BLOB);
}

@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testPutBufferFailsIncomingForJobHa() throws IOException {
testPutBufferFailsIncoming(new JobID(), PERMANENT_BLOB);
Expand Down Expand Up @@ -514,19 +507,16 @@ private void testPutBufferFailsIncoming(@Nullable final JobID jobId, BlobKey.Blo
}
}

@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testPutBufferFailsStoreNoJob() throws IOException {
testPutBufferFailsStore(null, TRANSIENT_BLOB);
}

@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testPutBufferFailsStoreForJob() throws IOException {
testPutBufferFailsStore(new JobID(), TRANSIENT_BLOB);
}

@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
@Test
void testPutBufferFailsStoreForJobHa() throws IOException {
testPutBufferFailsStore(new JobID(), PERMANENT_BLOB);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.apache.flink.util.OperatingSystem;

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;

Expand All @@ -37,7 +36,6 @@
import static org.assertj.core.api.Assumptions.assumeThat;

/** Tests for {@link BlobUtils} working on non-writable directories. */
@Tag("org.apache.flink.testutils.junit.FailsInGHAContainerWithRootUser")
class BlobUtilsNonWritableTest {

private static final String CANNOT_CREATE_THIS = "cannot-create-this";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,13 @@
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;
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;
Expand Down Expand Up @@ -325,7 +323,6 @@ public void testLibraryCacheManagerCleanup() throws Exception {
}

@Test
@Category(FailsInGHAContainerWithRootUser.class)
public void testRegisterAndDownload() throws IOException {
assumeTrue(!OperatingSystem.isWindows()); // setWritable doesn't work on Windows.

Expand Down
Loading