From 5ecb6e7000e60163a3e3980d8710e42c57bce91a Mon Sep 17 00:00:00 2001 From: voddle Date: Tue, 19 Sep 2023 15:32:57 +0800 Subject: [PATCH 1/3] trying to fix UfsFileIn/OutStreamTest --- .../java/alluxio/client/file/ufs/AbstractUfsStreamTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dora/core/client/fs/src/test/java/alluxio/client/file/ufs/AbstractUfsStreamTest.java b/dora/core/client/fs/src/test/java/alluxio/client/file/ufs/AbstractUfsStreamTest.java index da69b8e7864d..849d05115c82 100644 --- a/dora/core/client/fs/src/test/java/alluxio/client/file/ufs/AbstractUfsStreamTest.java +++ b/dora/core/client/fs/src/test/java/alluxio/client/file/ufs/AbstractUfsStreamTest.java @@ -55,7 +55,7 @@ public abstract class AbstractUfsStreamTest { @Parameterized.Parameters public static Collection data() { - return Arrays.asList(new Object[][] {{false}, {true}}); + return Arrays.asList(new Object[][] {{false}}); } /** @@ -81,6 +81,7 @@ public void before() { FileSystemOptions.Builder .fromConf(mConf) .setUfsFileSystemOptions(new UfsFileSystemOptions(ufs)) + .setDoraCacheEnabled(false) .build(); mFileSystem = FileSystem.Factory.create(FileSystemContext.create( ClientContext.create(mConf)), fileSystemOptions); From a1d27d5032593552694ce4d4f565accc01502186 Mon Sep 17 00:00:00 2001 From: voddle Date: Wed, 20 Sep 2023 18:23:25 +0800 Subject: [PATCH 2/3] fix --- .../file/ufs/AbstractUfsStreamTest.java | 22 +++---------------- .../client/file/ufs/UfsFileInStreamTest.java | 9 ++------ .../client/file/ufs/UfsFileOutStreamTest.java | 9 ++------ 3 files changed, 7 insertions(+), 33 deletions(-) diff --git a/dora/core/client/fs/src/test/java/alluxio/client/file/ufs/AbstractUfsStreamTest.java b/dora/core/client/fs/src/test/java/alluxio/client/file/ufs/AbstractUfsStreamTest.java index 849d05115c82..4532a7db2b60 100644 --- a/dora/core/client/fs/src/test/java/alluxio/client/file/ufs/AbstractUfsStreamTest.java +++ b/dora/core/client/fs/src/test/java/alluxio/client/file/ufs/AbstractUfsStreamTest.java @@ -22,8 +22,6 @@ import alluxio.client.file.options.UfsFileSystemOptions; import alluxio.conf.Configuration; import alluxio.conf.InstancedConfiguration; -import alluxio.conf.PropertyKey; -import alluxio.conf.Source; import alluxio.exception.AlluxioException; import alluxio.grpc.DeletePOptions; import alluxio.underfs.UnderFileSystemFactoryRegistry; @@ -32,18 +30,13 @@ import org.junit.After; import org.junit.Before; import org.junit.Ignore; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; import java.io.IOException; -import java.util.Arrays; -import java.util.Collection; import java.util.UUID; /** * Add unit tests for streams of {@link UfsBaseFileSystem}. */ -@RunWith(Parameterized.class) @DoraTestTodoItem(action = DoraTestTodoItem.Action.FIX, owner = "LuQQiu", comment = "fix the tests here because those APIs are still relevant") @Ignore @@ -53,20 +46,11 @@ public abstract class AbstractUfsStreamTest { protected AlluxioURI mRootUfs; protected FileSystem mFileSystem; - @Parameterized.Parameters - public static Collection data() { - return Arrays.asList(new Object[][] {{false}}); - } - /** * Runs {@link AbstractUfsStreamTest} with different configuration combinations. - * - * @param localDataCacheEnabled whether local data cache is enabled */ - public AbstractUfsStreamTest(boolean localDataCacheEnabled) { + public AbstractUfsStreamTest() { mConf = Configuration.copyGlobal(); - mConf.set(PropertyKey.USER_CLIENT_CACHE_ENABLED, - PropertyKey.USER_CLIENT_CACHE_ENABLED.formatValue(localDataCacheEnabled), Source.RUNTIME); } /** @@ -78,10 +62,10 @@ public void before() { mRootUfs = new AlluxioURI(ufs); UnderFileSystemFactoryRegistry.register(new LocalUnderFileSystemFactory()); final FileSystemOptions fileSystemOptions = - FileSystemOptions.Builder - .fromConf(mConf) + new FileSystemOptions.Builder() .setUfsFileSystemOptions(new UfsFileSystemOptions(ufs)) .setDoraCacheEnabled(false) + .setDataCacheEnabled(false) .build(); mFileSystem = FileSystem.Factory.create(FileSystemContext.create( ClientContext.create(mConf)), fileSystemOptions); diff --git a/dora/core/client/fs/src/test/java/alluxio/client/file/ufs/UfsFileInStreamTest.java b/dora/core/client/fs/src/test/java/alluxio/client/file/ufs/UfsFileInStreamTest.java index 74fdac6e1a35..5b62b5fa5cfc 100644 --- a/dora/core/client/fs/src/test/java/alluxio/client/file/ufs/UfsFileInStreamTest.java +++ b/dora/core/client/fs/src/test/java/alluxio/client/file/ufs/UfsFileInStreamTest.java @@ -26,8 +26,6 @@ import org.junit.Assume; import org.junit.Ignore; import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; import java.io.IOException; import java.io.OutputStream; @@ -37,18 +35,15 @@ /** * Add unit tests for {@link UfsFileInStream}. */ -@RunWith(Parameterized.class) @DoraTestTodoItem(action = DoraTestTodoItem.Action.FIX, owner = "LuQQiu", comment = "check if UfsBaseFS is still relevant and fix the tests if so") @Ignore public class UfsFileInStreamTest extends AbstractUfsStreamTest { /** * Runs {@link UfsFileInStreamTest} with different configuration combinations. - * - * @param localDataCacheEnabled whether local data cache is enabled */ - public UfsFileInStreamTest(boolean localDataCacheEnabled) { - super(localDataCacheEnabled); + public UfsFileInStreamTest() { + super(); } @Test diff --git a/dora/core/client/fs/src/test/java/alluxio/client/file/ufs/UfsFileOutStreamTest.java b/dora/core/client/fs/src/test/java/alluxio/client/file/ufs/UfsFileOutStreamTest.java index 7cc5e89a9463..b9631f76caa2 100644 --- a/dora/core/client/fs/src/test/java/alluxio/client/file/ufs/UfsFileOutStreamTest.java +++ b/dora/core/client/fs/src/test/java/alluxio/client/file/ufs/UfsFileOutStreamTest.java @@ -24,8 +24,6 @@ import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; import java.io.IOException; import java.io.InputStream; @@ -33,18 +31,15 @@ /** * Add unit tests for {@link UfsFileOutStream}. */ -@RunWith(Parameterized.class) @DoraTestTodoItem(action = DoraTestTodoItem.Action.FIX, owner = "LuQQiu", comment = "check if UfsBaseFS is still relevant and fix the tests if so") @Ignore public class UfsFileOutStreamTest extends AbstractUfsStreamTest { /** * Runs {@link UfsFileInStreamTest} with different configuration combinations. - * - * @param localDataCacheEnabled whether local data cache is enabled */ - public UfsFileOutStreamTest(boolean localDataCacheEnabled) { - super(localDataCacheEnabled); + public UfsFileOutStreamTest() { + super(); } @Test From ba27d2c10fdbb7f854d46ddd90bbee61d5ddf2bc Mon Sep 17 00:00:00 2001 From: voddle Date: Fri, 22 Sep 2023 15:06:36 +0800 Subject: [PATCH 3/3] removed redundent --- .../client/file/ufs/AbstractUfsStreamTest.java | 5 ----- .../alluxio/client/file/ufs/UfsFileInStreamTest.java | 11 ----------- .../alluxio/client/file/ufs/UfsFileOutStreamTest.java | 5 ----- 3 files changed, 21 deletions(-) diff --git a/dora/core/client/fs/src/test/java/alluxio/client/file/ufs/AbstractUfsStreamTest.java b/dora/core/client/fs/src/test/java/alluxio/client/file/ufs/AbstractUfsStreamTest.java index 4532a7db2b60..3745deb2f768 100644 --- a/dora/core/client/fs/src/test/java/alluxio/client/file/ufs/AbstractUfsStreamTest.java +++ b/dora/core/client/fs/src/test/java/alluxio/client/file/ufs/AbstractUfsStreamTest.java @@ -14,7 +14,6 @@ import alluxio.AlluxioTestDirectory; import alluxio.AlluxioURI; import alluxio.ClientContext; -import alluxio.annotation.dora.DoraTestTodoItem; import alluxio.client.file.FileSystem; import alluxio.client.file.FileSystemContext; import alluxio.client.file.URIStatus; @@ -29,7 +28,6 @@ import org.junit.After; import org.junit.Before; -import org.junit.Ignore; import java.io.IOException; import java.util.UUID; @@ -37,9 +35,6 @@ /** * Add unit tests for streams of {@link UfsBaseFileSystem}. */ -@DoraTestTodoItem(action = DoraTestTodoItem.Action.FIX, owner = "LuQQiu", - comment = "fix the tests here because those APIs are still relevant") -@Ignore public abstract class AbstractUfsStreamTest { protected static final int CHUNK_SIZE = 100; protected InstancedConfiguration mConf; diff --git a/dora/core/client/fs/src/test/java/alluxio/client/file/ufs/UfsFileInStreamTest.java b/dora/core/client/fs/src/test/java/alluxio/client/file/ufs/UfsFileInStreamTest.java index 5b62b5fa5cfc..6d7223f83a28 100644 --- a/dora/core/client/fs/src/test/java/alluxio/client/file/ufs/UfsFileInStreamTest.java +++ b/dora/core/client/fs/src/test/java/alluxio/client/file/ufs/UfsFileInStreamTest.java @@ -16,7 +16,6 @@ import static org.junit.Assert.assertTrue; import alluxio.AlluxioURI; -import alluxio.annotation.dora.DoraTestTodoItem; import alluxio.client.file.FileInStream; import alluxio.conf.PropertyKey; import alluxio.exception.AlluxioException; @@ -24,7 +23,6 @@ import org.junit.Assert; import org.junit.Assume; -import org.junit.Ignore; import org.junit.Test; import java.io.IOException; @@ -35,9 +33,6 @@ /** * Add unit tests for {@link UfsFileInStream}. */ -@DoraTestTodoItem(action = DoraTestTodoItem.Action.FIX, owner = "LuQQiu", - comment = "check if UfsBaseFS is still relevant and fix the tests if so") -@Ignore public class UfsFileInStreamTest extends AbstractUfsStreamTest { /** * Runs {@link UfsFileInStreamTest} with different configuration combinations. @@ -90,7 +85,6 @@ public void manyBytesRead() throws IOException, AlluxioException { } @Test - @Ignore public void manyBytesReadByteBuffer() throws IOException, AlluxioException { AlluxioURI ufsPath = getUfsPath(); createFile(ufsPath, CHUNK_SIZE); @@ -102,7 +96,6 @@ public void manyBytesReadByteBuffer() throws IOException, AlluxioException { } @Test - @Ignore public void readAll() throws IOException, AlluxioException { int len = CHUNK_SIZE * 5; int start = 0; @@ -119,7 +112,6 @@ public void readAll() throws IOException, AlluxioException { } @Test - @Ignore public void readAllByteBuffer() throws IOException, AlluxioException { int len = CHUNK_SIZE * 5; int start = 0; @@ -237,7 +229,6 @@ public void readNullBuffer() throws IOException, AlluxioException { } @Test - @Ignore public void readNullArrayOffset() throws IOException, AlluxioException { AlluxioURI ufsPath = getUfsPath(); createFile(ufsPath, CHUNK_SIZE); @@ -348,7 +339,6 @@ public void seekToBeginning() throws IOException, AlluxioException { } @Test - @Ignore public void seekForwardAndBackward() throws IOException, AlluxioException { AlluxioURI ufsPath = getUfsPath(); createFile(ufsPath, CHUNK_SIZE); @@ -418,7 +408,6 @@ public void skipToEnd() throws IOException, AlluxioException { } @Test - @Ignore public void skipPassEnd() throws IOException, AlluxioException { AlluxioURI ufsPath = getUfsPath(); createFile(ufsPath, CHUNK_SIZE); diff --git a/dora/core/client/fs/src/test/java/alluxio/client/file/ufs/UfsFileOutStreamTest.java b/dora/core/client/fs/src/test/java/alluxio/client/file/ufs/UfsFileOutStreamTest.java index b9631f76caa2..323d01fb1061 100644 --- a/dora/core/client/fs/src/test/java/alluxio/client/file/ufs/UfsFileOutStreamTest.java +++ b/dora/core/client/fs/src/test/java/alluxio/client/file/ufs/UfsFileOutStreamTest.java @@ -16,13 +16,11 @@ import static org.junit.Assert.assertThrows; import alluxio.AlluxioURI; -import alluxio.annotation.dora.DoraTestTodoItem; import alluxio.client.file.FileOutStream; import alluxio.exception.AlluxioException; import alluxio.util.io.BufferUtils; import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; import java.io.IOException; @@ -31,9 +29,6 @@ /** * Add unit tests for {@link UfsFileOutStream}. */ -@DoraTestTodoItem(action = DoraTestTodoItem.Action.FIX, owner = "LuQQiu", - comment = "check if UfsBaseFS is still relevant and fix the tests if so") -@Ignore public class UfsFileOutStreamTest extends AbstractUfsStreamTest { /** * Runs {@link UfsFileInStreamTest} with different configuration combinations.