mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2026-11-25 13:11:36 +00:00
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:
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user