From d04c822b5835f34fb7153e5c86599bf1e3ba0f45 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 29 Nov 2016 08:54:36 -0800 Subject: [PATCH] Unique-ify uds address between concurrent bm_fullstack runs --- test/cpp/microbenchmarks/bm_fullstack.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/cpp/microbenchmarks/bm_fullstack.cc b/test/cpp/microbenchmarks/bm_fullstack.cc index 559e66cdd70..696b453fa31 100644 --- a/test/cpp/microbenchmarks/bm_fullstack.cc +++ b/test/cpp/microbenchmarks/bm_fullstack.cc @@ -128,7 +128,16 @@ class TCP : public FullstackFixture { class UDS : public FullstackFixture { public: - UDS(Service* service) : FullstackFixture(service, "unix:bm_fullstack") {} + UDS(Service* service) : FullstackFixture(service, MakeAddress()) {} + + private: + static grpc::string MakeAddress() { + int port = grpc_pick_unused_port_or_die(); // just for a unique id - not a + // real port + std::stringstream addr; + addr << "unix:/tmp/bm_fullstack." << port; + return addr.str(); + } }; class EndpointPairFixture {