GRPC testing - output verbosity

Does anyone have any tips for testing Grpc servers in Elixir. I have the server implemented and connecting to it using the generated Stub. This all works fine. However, each time Grpc connection is lost, it spews error into console. I was going to test each request separately, creating a new connection each time. Each time client disconnects, it logs this unfriendly message. This would pollute the console with these errors…not nice.

22:35:08.030 [error] Ranch listener "ISCloud.Endpoint" had connection process started with :cowboy_clear:start_link/4 at #PID<0.832.0> exit with reason: {:undef, [{:cow_http2_machine, :set_last_streamid, [{:http2_machine, :server, %{env: %{dispatch: [{:_, [], [{:_, [], GRPC.Adapter.Cowboy.Handler, {ISCloud.Endpoint, %{"ISCloud.Cloud" => ISCloud.Server},.....
2 Likes

Did you ever find a way to catch this? Thx.

Looks like I added an on_exit in the test setup. hacky

  on_exit(fn ->
      # Stop the GRPC server, note, we change logger level because Cowboy/rancher belches an ugly error when
      # connect is lost
      ll = Logger.level()
      Logger.configure(level: :critical)
      GRPC.Server.stop(MyServer.Server)
      Logger.configure(level: ll)
    end)