diff --git a/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/impl/ITestS3APutIfMatchAndIfNoneMatch.java b/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/impl/ITestS3APutIfMatchAndIfNoneMatch.java index 7939b39935b3a..bf915ed4f115b 100644 --- a/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/impl/ITestS3APutIfMatchAndIfNoneMatch.java +++ b/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/impl/ITestS3APutIfMatchAndIfNoneMatch.java @@ -469,8 +469,11 @@ public void testIfMatchOverwriteWithOutdatedEtag() throws Throwable { .as("ETag should not be null after file creation") .isNotNull(); + String updatedFileContent = "Updated content"; + byte[] updatedData = updatedFileContent.getBytes(StandardCharsets.UTF_8); + // Overwrite the file. Will update the etag, making the previously fetched etag outdated. - createFileWithFlags(fs, path, SMALL_FILE_BYTES, false, null); + createFileWithFlags(fs, path, updatedData, false, null); // overwrite file with outdated etag. Should throw RemoteFileChangedException RemoteFileChangedException exception = intercept(RemoteFileChangedException.class,