Skip to content

Commit

Permalink
Improves waiting/connect attempt messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mscottford committed Sep 1, 2023
1 parent 1c6d997 commit cc3868f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/corgibytes/freshli/commons/step_definitions/grpc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,20 @@
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|
GrpcClient.new(port).shutdown!
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
Expand Down

0 comments on commit cc3868f

Please sign in to comment.