Skip to content

Commit 24589a5

Browse files
test(deps): update gcr.io/cloud-devrel-public-resources/storage-testbench docker tag to v0.55.0 (googleapis#3100)
* test(deps): update gcr.io/cloud-devrel-public-resources/storage-testbench docker tag to v0.55.0 * test: remove crc32c related assertion for non-finalized appendable uploads --------- Co-authored-by: BenWhitehead <[email protected]>
1 parent a3086e8 commit 24589a5

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

google-cloud-storage/src/test/java/com/google/cloud/storage/ITAppendableUploadTest.java

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import com.google.cloud.storage.BlobAppendableUpload.AppendableUploadWriteableByteChannel;
2323
import com.google.cloud.storage.BlobAppendableUploadConfig.CloseAction;
24+
import com.google.cloud.storage.Crc32cValue.Crc32cLengthKnown;
2425
import com.google.cloud.storage.TransportCompatibility.Transport;
2526
import com.google.cloud.storage.it.runner.StorageITRunner;
2627
import com.google.cloud.storage.it.runner.annotations.Backend;
@@ -104,12 +105,22 @@ public void appendableBlobUploadWithoutFinalizing() throws Exception {
104105
() -> assertThat(actual).isNotNull(),
105106
() -> assertThat(actual.getSize()).isEqualTo(512 * 1024 - 1),
106107
() -> {
107-
String crc32c = actual.getCrc32c();
108-
// prod is null
109-
boolean crc32cNull = crc32c == null;
110-
// testbench is 0
111-
boolean crc32cZero = Utils.crc32cCodec.encode(0).equalsIgnoreCase(crc32c);
112-
assertThat(crc32cNull || crc32cZero).isTrue();
108+
// TODO: re-enable this when crc32c behavior is better defined when multiple flushes
109+
// and state lookups happen for incomplete uploads.
110+
if (false) {
111+
String crc32c = actual.getCrc32c();
112+
// prod is null
113+
boolean crc32cNull = crc32c == null;
114+
// testbench v0.54.0+ will have the crc32c of the first flush, regardless if more has
115+
// been flushed since then.
116+
// While the following assertion can pass for v0.54.0 and v0.55.0 it's janky, and not
117+
// something I want to depend upon. So, for now it's skipped, with this comment and
118+
// code left as a skeleton of what should be filled in.
119+
Crc32cLengthKnown a1hash = Hasher.enabled().hash(ByteBuffer.wrap(a1));
120+
boolean crc32cZero =
121+
Utils.crc32cCodec.encode(a1hash.getValue()).equalsIgnoreCase(crc32c);
122+
assertThat(crc32cNull || crc32cZero).isTrue();
123+
}
113124
});
114125
}
115126

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
FROM gcr.io/cloud-devrel-public-resources/storage-testbench:v0.52.0
1+
FROM gcr.io/cloud-devrel-public-resources/storage-testbench:v0.55.0

0 commit comments

Comments
 (0)