This is an automated email from the ASF dual-hosted git repository.
tvalentyn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/master by this push:
new 23e23981b63 Fix GCP IO tests on Java 21 (#39295)
23e23981b63 is described below
commit 23e23981b63d62fd36a61d69bf495bd893a30877
Author: Bruno Volpato <[email protected]>
AuthorDate: Mon Jul 13 09:46:19 2026 -0400
Fix GCP IO tests on Java 21 (#39295)
---
sdks/java/io/google-cloud-platform/build.gradle | 5 +++++
.../sdk/io/gcp/bigquery/BeamRowToStorageApiProtoTest.java | 11 ++++++++---
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/sdks/java/io/google-cloud-platform/build.gradle
b/sdks/java/io/google-cloud-platform/build.gradle
index c8cc9958e2f..1555297ab10 100644
--- a/sdks/java/io/google-cloud-platform/build.gradle
+++ b/sdks/java/io/google-cloud-platform/build.gradle
@@ -30,6 +30,11 @@ applyJavaNature(
description = "Apache Beam :: SDKs :: Java :: IO :: Google Cloud Platform"
ext.summary = "IO library to read and write Google Cloud Platform systems from
Beam."
+tasks.withType(Test).configureEach {
+ // Open java.nio for Apache Arrow direct memory access under Java 17+
+ jvmArgs '--add-opens=java.base/java.nio=ALL-UNNAMED'
+}
+
dependencies {
implementation(enforcedPlatform(library.java.google_cloud_platform_libraries_bom))
implementation project(path: ":model:pipeline", configuration: "shadow")
diff --git
a/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/bigquery/BeamRowToStorageApiProtoTest.java
b/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/bigquery/BeamRowToStorageApiProtoTest.java
index 88bf3ef3f14..50fb2c07362 100644
---
a/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/bigquery/BeamRowToStorageApiProtoTest.java
+++
b/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/bigquery/BeamRowToStorageApiProtoTest.java
@@ -62,6 +62,11 @@ import org.junit.runners.JUnit4;
/** Unit tests form {@link BeamRowToStorageApiProto}. */
@RunWith(JUnit4.class)
public class BeamRowToStorageApiProtoTest {
+ private static final LocalTime TEST_TIME_MICROS = LocalTime.of(12, 30, 45,
123_456_000);
+ private static final LocalDateTime TEST_DATETIME_MICROS =
+ LocalDateTime.of(2024, 1, 15, 12, 30, 45, 123_456_000);
+ private static final java.time.Instant TEST_INSTANT_MICROS =
+ java.time.Instant.parse("2024-01-15T12:30:45.123456Z");
private static final java.time.Instant TEST_INSTANT_NANOS =
java.time.Instant.parse("2024-01-15T12:30:45.123456789Z");
@@ -254,9 +259,9 @@ public class BeamRowToStorageApiProtoTest {
.withFieldValue("arrayNullValue", null)
.withFieldValue("iterableValue", ImmutableList.of("blue", "red",
"two", "one"))
.withFieldValue("sqlDateValue", LocalDate.now(ZoneOffset.UTC))
- .withFieldValue("sqlTimeValue", LocalTime.now(ZoneOffset.UTC))
- .withFieldValue("sqlDatetimeValue",
LocalDateTime.now(ZoneOffset.UTC))
- .withFieldValue("sqlTimestampValue",
java.time.Instant.now().plus(123, ChronoUnit.MICROS))
+ .withFieldValue("sqlTimeValue", TEST_TIME_MICROS)
+ .withFieldValue("sqlDatetimeValue", TEST_DATETIME_MICROS)
+ .withFieldValue("sqlTimestampValue", TEST_INSTANT_MICROS)
.withFieldValue("enumValue", TEST_ENUM.valueOf("RED"))
.build();
private static final Map<String, Object> BASE_PROTO_EXPECTED_FIELDS =