test: use unique ipc addresses that the tests remove

- the in-process tests used fixed, relative ipc addresses; the socket
  files stayed in the build directory (99 files after 6 runs), and two
  runs of the same test at the same time could share a socket
- use test::IpcAddress: a unique path in /tmp that the destructor
  removes
- drop the session suffix of the inproc addresses: an inproc address
  is local to the process

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Claude
2026-11-03 14:16:33 +00:00
committed by Dennis Klein
parent 0367c2a4a8
commit 3c752937a4
6 changed files with 70 additions and 60 deletions

View File

@@ -10,6 +10,7 @@
#include "TestReceiver.h"
#include "../helper/ControlDevice.h"
#include "../helper/Transport.h"
#include <gtest/gtest.h>
@@ -36,12 +37,14 @@ void control(Device& device)
class MultipleDevices : public ::testing::Test {
public:
test::IpcAddress const fAddress{"multiple_devices"};
bool TestFirst()
{
test::Sender sender("data");
sender.SetTransport("zeromq");
Channel channel("push", "connect", "ipc://multiple-devices-test");
Channel channel("push", "connect", fAddress);
channel.UpdateRateLogging(0);
sender.AddChannel("data", std::move(channel));
@@ -54,7 +57,7 @@ class MultipleDevices : public ::testing::Test {
test::Receiver receiver("data");
receiver.SetTransport("zeromq");
Channel channel("pull", "bind", "ipc://multiple-devices-test");
Channel channel("pull", "bind", fAddress);
channel.UpdateRateLogging(0);
receiver.AddChannel("data", std::move(channel));