From cd50315bc42d803fd30329177c690bda1db521c5 Mon Sep 17 00:00:00 2001 From: Mike Prieto Date: Mon, 13 May 2024 20:00:45 +0000 Subject: [PATCH 1/5] test: Fix ordered publish failure test by forcing scheduled work to be done --- .../google/cloud/pubsub/v1/PublisherImplTest.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/PublisherImplTest.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/PublisherImplTest.java index 9785b7716..ce42d8ee6 100644 --- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/PublisherImplTest.java +++ b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/PublisherImplTest.java @@ -511,9 +511,6 @@ public void testEnableMessageOrdering_overwritesMaxAttempts() throws Exception { *
  • publish with key orderA, which should now succeed * */ - /* - Temporarily disabled due to https://github.com/googleapis/java-pubsub/issues/1861. - TODO(maitrimangal): Enable once resolved. @Test public void testResumePublish() throws Exception { Publisher publisher = @@ -575,8 +572,8 @@ public void testResumePublish() throws Exception { testPublisherServiceImpl.addPublishResponse( PublishResponse.newBuilder().addMessageIds("5").addMessageIds("6")); - Assert.assertEquals("5", future5.get()); - Assert.assertEquals("6", future6.get()); + assertEquals("5", future5.get()); + assertEquals("6", future6.get()); // Resume publishing of "orderA", which should now succeed publisher.resumePublish("orderA"); @@ -587,8 +584,8 @@ public void testResumePublish() throws Exception { testPublisherServiceImpl.addPublishResponse( PublishResponse.newBuilder().addMessageIds("7").addMessageIds("8")); - Assert.assertEquals("7", future7.get()); - Assert.assertEquals("8", future8.get()); + assertEquals("7", future7.get()); + assertEquals("8", future8.get()); shutdownTestPublisher(publisher); } @@ -633,6 +630,7 @@ public void testPublishThrowExceptionForUnsubmittedOrderingKeyMessage() throws E } catch (ExecutionException e) { assertEquals(SequentialExecutorService.CallbackExecutor.CANCELLATION_EXCEPTION, e.getCause()); } + fakeExecutor.advanceTime(Duration.ZERO); // A subsequent attempt fails immediately. ApiFuture publishFuture4 = sendTestMessageWithOrderingKey(publisher, "D", "a"); @@ -643,7 +641,6 @@ public void testPublishThrowExceptionForUnsubmittedOrderingKeyMessage() throws E assertEquals(SequentialExecutorService.CallbackExecutor.CANCELLATION_EXCEPTION, e.getCause()); } } - */ private ApiFuture sendTestMessageWithOrderingKey( Publisher publisher, String data, String orderingKey) { From 759424fc4ce00417277219a6ff391115a192c650 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 14 May 2024 07:08:14 +0000 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f53076790..afdf7aba6 100644 --- a/README.md +++ b/README.md @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-pubsub' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-pubsub:1.129.3' +implementation 'com.google.cloud:google-cloud-pubsub:1.129.4' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-pubsub" % "1.129.3" +libraryDependencies += "com.google.cloud" % "google-cloud-pubsub" % "1.129.4" ``` @@ -411,7 +411,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-pubsub/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-pubsub.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-pubsub/1.129.3 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-pubsub/1.129.4 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles From 2581a7a396d19064044a1ec7f5e8ce64fe92dc25 Mon Sep 17 00:00:00 2001 From: Mike Prieto Date: Tue, 14 May 2024 18:31:21 +0000 Subject: [PATCH 3/5] test: Advance the executor by 5 seconds in the ordering publish failure test --- .../test/java/com/google/cloud/pubsub/v1/PublisherImplTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/PublisherImplTest.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/PublisherImplTest.java index ce42d8ee6..df5183e0b 100644 --- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/PublisherImplTest.java +++ b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/PublisherImplTest.java @@ -630,7 +630,7 @@ public void testPublishThrowExceptionForUnsubmittedOrderingKeyMessage() throws E } catch (ExecutionException e) { assertEquals(SequentialExecutorService.CallbackExecutor.CANCELLATION_EXCEPTION, e.getCause()); } - fakeExecutor.advanceTime(Duration.ZERO); + fakeExecutor.advanceTime(Duration.ofSeconds(5)); // A subsequent attempt fails immediately. ApiFuture publishFuture4 = sendTestMessageWithOrderingKey(publisher, "D", "a"); From 0b85a3cc8059d2706d4bca4393b612afbbc92396 Mon Sep 17 00:00:00 2001 From: Mike Prieto Date: Tue, 14 May 2024 21:16:57 +0000 Subject: [PATCH 4/5] test: Change advance duration back to zero --- .../test/java/com/google/cloud/pubsub/v1/PublisherImplTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/PublisherImplTest.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/PublisherImplTest.java index df5183e0b..ce42d8ee6 100644 --- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/PublisherImplTest.java +++ b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/PublisherImplTest.java @@ -630,7 +630,7 @@ public void testPublishThrowExceptionForUnsubmittedOrderingKeyMessage() throws E } catch (ExecutionException e) { assertEquals(SequentialExecutorService.CallbackExecutor.CANCELLATION_EXCEPTION, e.getCause()); } - fakeExecutor.advanceTime(Duration.ofSeconds(5)); + fakeExecutor.advanceTime(Duration.ZERO); // A subsequent attempt fails immediately. ApiFuture publishFuture4 = sendTestMessageWithOrderingKey(publisher, "D", "a"); From e58cad4ec3e60d7f269be958e159cac80949fcd9 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 20 May 2024 15:25:09 +0000 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index afdf7aba6..89a1ab8e1 100644 --- a/README.md +++ b/README.md @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-pubsub' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-pubsub:1.129.4' +implementation 'com.google.cloud:google-cloud-pubsub:1.129.5' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-pubsub" % "1.129.4" +libraryDependencies += "com.google.cloud" % "google-cloud-pubsub" % "1.129.5" ``` @@ -411,7 +411,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-pubsub/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-pubsub.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-pubsub/1.129.4 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-pubsub/1.129.5 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles