From f28c1f16c0ae62c71cb83d81c7f5d2e8b2ffd454 Mon Sep 17 00:00:00 2001 From: Ahmar Suhail Date: Fri, 18 Jul 2025 13:29:21 +0100 Subject: [PATCH] create new file with updated data --- .../hadoop/fs/s3a/impl/ITestS3APutIfMatchAndIfNoneMatch.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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,