Skip to content

Commit

Permalink
Fix flakiness of migrate test
Browse files Browse the repository at this point in the history
This test became flaky when the default write type became async-through.
This is because when the migrate is configured to delete the source,
sometimes, that inode is NOT persisted, so it is not removed from the
UFS. Then, on the `exists` call, it will loadMetadata from UFS, and it
will load the file from UFS and the deleted file will "return".

pr-link: #9884
change-id: cid-d9c66bd59b9e4180756dc13a8ac243f6951aafbe
  • Loading branch information
gpang authored and alluxio-bot committed Sep 13, 2019
1 parent dcfd9cf commit 714d0a8
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -15,6 +15,8 @@
import alluxio.client.WriteType;
import alluxio.client.file.FileInStream;
import alluxio.client.file.FileOutStream;
import alluxio.grpc.CreateFilePOptions;
import alluxio.grpc.WritePType;
import alluxio.job.JobIntegrationTest;
import alluxio.job.wire.JobInfo;

Expand Down Expand Up @@ -103,7 +105,8 @@ public void migrateDirectory() throws Exception {
* Creates a file with the given name containing TEST_BYTES.
*/
private void createFileWithTestBytes(String filename) throws Exception {
try (FileOutStream out = mFileSystem.createFile(new AlluxioURI(filename))) {
try (FileOutStream out = mFileSystem.createFile(new AlluxioURI(filename),
CreateFilePOptions.newBuilder().setWriteType(WritePType.CACHE_THROUGH).build())) {
out.write(TEST_BYTES);
}
Assert.assertTrue(mFileSystem.exists(new AlluxioURI(filename)));
Expand Down

0 comments on commit 714d0a8

Please sign in to comment.