test: use 100 MB shm segments in all shmem tests

- The shmem default segment is 2 GiB, and Boost reserves it with
  posix_fallocate, so each test takes 2 GiB of /dev/shm
- Parallel test runs then exhaust /dev/shm and segment creation
  fails with "No space left on device"
- Set --shm-segment-size 100000000 like the other tests already do

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Claude
2026-11-03 15:27:48 +00:00
committed by Dennis Klein
parent c506758d2f
commit 3077d1c0ab
5 changed files with 7 additions and 0 deletions

View File

@@ -103,6 +103,7 @@ auto testConnectedPeers(std::string const& transport)
ProgOptions config;
config.SetProperty<string>("session", tools::Uuid());
config.SetProperty<bool>("shm-monitor", true);
config.SetProperty<size_t>("shm-segment-size", 100000000);
string const address(tools::ToString("ipc://", config.GetProperty<string>("session")));
unsigned long constexpr zero(0), one(1);
auto factory(TransportFactory::CreateTransportFactory(transport, tools::Uuid(), &config));

View File

@@ -34,6 +34,7 @@ class BadDevice : public Device
EXPECT_THROW(RunStateMachine(), MessageError);
});
GetConfig()->SetProperty<size_t>("shm-segment-size", 100000000);
SetTransport("shmem");
ChangeStateOrThrow(Transition::InitDevice);

View File

@@ -81,6 +81,7 @@ TEST(MemoryResources, transportAllocatorMap)
ProgOptions config;
config.SetProperty<string>("session", to_string(session));
config.SetProperty<bool>("shm-monitor", true);
config.SetProperty<size_t>("shm-segment-size", 100000000);
FactoryType factoryZMQ = TransportFactory::CreateTransportFactory("zeromq", fair::mq::tools::Uuid(), &config);
FactoryType factorySHM = TransportFactory::CreateTransportFactory("shmem", fair::mq::tools::Uuid(), &config);
@@ -132,6 +133,7 @@ TEST(MemoryResources, getMessage)
ProgOptions config;
config.SetProperty<std::string>("session", to_string(session));
config.SetProperty<bool>("shm-monitor", true);
config.SetProperty<size_t>("shm-segment-size", 100000000);
FactoryType factoryZMQ = TransportFactory::CreateTransportFactory("zeromq", fair::mq::tools::Uuid(), &config);
FactoryType factorySHM = TransportFactory::CreateTransportFactory("shmem", fair::mq::tools::Uuid(), &config);

View File

@@ -40,6 +40,7 @@ auto RunPoller(string transport, int pollType) -> void
<< " --transport " << transport
<< " --color false"
<< " --shm-monitor true"
<< " --shm-segment-size 100000000"
<< " --session " << session
<< " --channel-config name=data1,type=push,method=bind,address=" << data1Address
<< " name=data2,type=push,method=bind,address=" << data2Address;
@@ -55,6 +56,7 @@ auto RunPoller(string transport, int pollType) -> void
<< " --transport " << transport
<< " --color false"
<< " --shm-monitor true"
<< " --shm-segment-size 100000000"
<< " --session " << session
<< " --poll-type " << pollType
<< " --channel-config name=data1,type=pull,method=connect,address=" << data1Address

View File

@@ -27,6 +27,7 @@ void GetFreeMemory()
string sessionId(to_string(tools::UuidHash()));
config.SetProperty<string>("session", sessionId);
config.SetProperty<bool>("shm-monitor", true);
config.SetProperty<size_t>("shm-segment-size", 100000000);
ASSERT_THROW(shmem::Monitor::GetFreeMemory(shmem::SessionId{sessionId}, 0), shmem::Monitor::MonitorError);