This is an automated email from the ASF dual-hosted git repository.
hepin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko-grpc.git
The following commit(s) were added to refs/heads/main by this push:
new 407bbce4 Fix NonBalancingIntegrationSpec flakiness (#651)
407bbce4 is described below
commit 407bbce40b633ce263f20bbeb14d9c802ef132cb
Author: He-Pin(kerr) <[email protected]>
AuthorDate: Sun Mar 8 19:37:42 2026 +0800
Fix NonBalancingIntegrationSpec flakiness (#651)
Port upstream akka/akka-grpc@93c78cd4.
Add a 250ms sleep after server termination to allow unbind to fully
complete before restarting on the same port. Also simplify the second
connection wait to use futureValue with explicit timeout, removing
the Netty-specific flakiness workaround.
Co-authored-by: Copilot <[email protected]>
---
.../pekko/grpc/scaladsl/NonBalancingIntegrationSpec.scala | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git
a/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/NonBalancingIntegrationSpec.scala
b/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/NonBalancingIntegrationSpec.scala
index 1c3079f8..73089dec 100644
---
a/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/NonBalancingIntegrationSpec.scala
+++
b/interop-tests/src/test/scala/org/apache/pekko/grpc/scaladsl/NonBalancingIntegrationSpec.scala
@@ -87,20 +87,15 @@ class NonBalancingIntegrationSpec(backend: String)
Future.sequence(requestsOnFirstConnection).futureValue
server1.terminate(5.seconds).futureValue
+ // Give it some time to complete unbind (suspected to cause test
flakyness)
+ Thread.sleep(250)
// And restart
Http().newServerAt("127.0.0.1",
server1.localAddress.getPort).bind(GreeterServiceHandler(service1)).futureValue
val requestsOnSecondConnection =
List.fill(requestsPerConnection)(client.sayHello(HelloRequest(s"Hello")))
- val replies = Future.sequence(requestsOnSecondConnection)
- Await.ready(replies, 15.seconds)
-
- if (this.isInstanceOf[NonBalancingIntegrationSpecNetty] &&
service1.greetings.get != numberOfRequests) {
- system.log.warning(
- s"Found only ${service1.greetings.get} requests rather than
$numberOfRequests, likely a flaky test")
- pending
- } else
- service1.greetings.get should be(numberOfRequests)
+
Future.sequence(requestsOnSecondConnection).futureValue(timeout(15.seconds))
+ service1.greetings.get should be(numberOfRequests)
}
"re-discover endpoints on failure" in {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]