Fix CI unit tests (#5196)

- Add retries for rpc client
- Add dynamic port allocation for rpc servers
This commit is contained in:
Olek
2025-01-28 10:45:59 -05:00
committed by GitHub
parent b6e3453f49
commit 50b8f19cb5
31 changed files with 293 additions and 146 deletions

View File

@@ -299,8 +299,8 @@ public:
serverPort.back().port = 0;
serverPort.back().protocol.insert("http");
auto eps = s->ports(serverPort);
test_request(eps[0]);
test_keepalive(eps[0]);
test_request(eps.begin()->second);
test_keepalive(eps.begin()->second);
// s->close();
s = nullptr;
pass();
@@ -423,7 +423,20 @@ public:
std::make_unique<CaptureLogs>(&messages)};
});
BEAST_EXPECT(
messages.find("Invalid value '0' for key 'port' in [port_rpc]") !=
messages.find("Invalid value '0' for key 'port' in [port_rpc]") ==
std::string::npos);
except([&] {
Env env{
*this,
envconfig([](std::unique_ptr<Config> cfg) {
(*cfg)["server"].set("port", "0");
return cfg;
}),
std::make_unique<CaptureLogs>(&messages)};
});
BEAST_EXPECT(
messages.find("Invalid value '0' for key 'port' in [server]") !=
std::string::npos);
except([&] {