From cc3868f1c4ef93077bbd120b54e5d95e44fe8050 Mon Sep 17 00:00:00 2001 From: "M. Scott Ford" Date: Fri, 1 Sep 2023 14:31:04 -0400 Subject: [PATCH] Improves waiting/connect attempt messages --- lib/corgibytes/freshli/commons/step_definitions/grpc.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/corgibytes/freshli/commons/step_definitions/grpc.rb b/lib/corgibytes/freshli/commons/step_definitions/grpc.rb index fcb45b7..109fc39 100644 --- a/lib/corgibytes/freshli/commons/step_definitions/grpc.rb +++ b/lib/corgibytes/freshli/commons/step_definitions/grpc.rb @@ -15,7 +15,9 @@ end When('I wait for the freshli_agent.proto gRPC service to be running on port {int}') do |port| - GrpcClient.new(port).wait_until_running! + GrpcClient.new(port).wait_until_running! do |attempts| + log("Checking gRPC service health. Attempt ##{attempts}.") + end end When('the gRPC service on port {int} is sent the shutdown command') do |port| @@ -23,7 +25,10 @@ end Then('there are no services running on port {int}') do |port| - expect(Ports.available?(port) { |attempts| log(attempts) }).to be_truthy + is_port_available = Ports.available?(port) do |attempts| + log("Checking port availability. Attempt ##{attempts}.") + end + expect(is_port_available).to be_truthy end test_services = TestServices.new