       end
     end
 
-    {:ok, client} = Client.start_link("localhost", ctx.port, name: TestClientName)
+    {:ok, client} = Client.start_link("localhost", port, name: client_name)
 
-    {:ok, client: client}
+    {:ok, client: client, client_name: client_name}
   end
 
   thrift_test "it can return a simple boolean value", ctx do

    assert "username" == Agent.get(:server_args, &(&1))
  end

  thrift_test "client can be found by name", ctx do
    assert ctx.client == Process.whereis(TestClientName)
  end

  thrift_test "client methods can be called by name instead of pid", _ctx do
    assert {:ok, true} == Client.ping(TestClientName)
  end
end

    {:ok, handler_name: mod_name, port: server_port}
  end

  setup(%{port: port, test: client_name}) do
    {:ok, agent} = Agent.start_link(fn -> nil end, name: :server_args)

    on_exit fn ->
