diff options
| author | Dan Engelbrecht <[email protected]> | 2024-04-18 17:48:45 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2024-04-18 17:48:45 +0200 |
| commit | f84af894f6c751e3643647229ae2e95d54c0ea31 (patch) | |
| tree | 5b9c1554e276f455785cf0626881ca789816f975 /src/zenserver-test/zenserver-test.cpp | |
| parent | safer oplog import (#52) (diff) | |
| download | zen-f84af894f6c751e3643647229ae2e95d54c0ea31.tar.xz zen-f84af894f6c751e3643647229ae2e95d54c0ea31.zip | |
capture zenserver output on error (#51)
* capture spawned server output and output on launch error
* fix logging and launch validation in tests
Diffstat (limited to 'src/zenserver-test/zenserver-test.cpp')
| -rw-r--r-- | src/zenserver-test/zenserver-test.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/zenserver-test/zenserver-test.cpp b/src/zenserver-test/zenserver-test.cpp index aa711ab7c..4d2c507fe 100644 --- a/src/zenserver-test/zenserver-test.cpp +++ b/src/zenserver-test/zenserver-test.cpp @@ -234,7 +234,9 @@ TEST_CASE("multi.basic") ZEN_INFO("Waiting..."); const uint16_t PortNum1 = Instance1.WaitUntilReady(); + CHECK_MESSAGE(PortNum1 != 0, Instance1.GetLogOutput()); const uint16_t PortNum2 = Instance2.WaitUntilReady(); + CHECK_MESSAGE(PortNum2 != 0, Instance1.GetLogOutput()); std::atomic<uint64_t> RequestCount{0}; std::atomic<uint64_t> BatchCounter{0}; @@ -478,6 +480,7 @@ namespace utils { Inst.SetTestDir(DataDir); Inst.SpawnServer(Port, Args); const uint16_t InstancePort = Inst.WaitUntilReady(); + CHECK_MESSAGE(InstancePort != 0, Inst.GetLogOutput()); if (Port != InstancePort) ZEN_DEBUG("relocation detected from {} to {}", Port, InstancePort); @@ -738,6 +741,7 @@ TEST_CASE("zcache.cbpackage") LocalInstance.SpawnServer(TestEnv.GetNewPortNumber(), fmt::format("--upstream-thread-count=0 --upstream-zen-url=http://localhost:{}", RemotePortNumber)); const uint16_t LocalPortNumber = LocalInstance.WaitUntilReady(); + CHECK_MESSAGE(LocalPortNumber != 0, LocalInstance.GetLogOutput()); const auto LocalBaseUri = fmt::format("http://localhost:{}/z$", LocalPortNumber); const auto RemoteBaseUri = fmt::format("http://localhost:{}/z$", RemotePortNumber); @@ -798,6 +802,7 @@ TEST_CASE("zcache.cbpackage") LocalInstance.SpawnServer(TestEnv.GetNewPortNumber(), fmt::format("--upstream-thread-count=0 --upstream-zen-url=http://localhost:{}", RemotePortNumber)); const uint16_t LocalPortNumber = LocalInstance.WaitUntilReady(); + CHECK_MESSAGE(LocalPortNumber != 0, LocalInstance.GetLogOutput()); const auto LocalBaseUri = fmt::format("http://localhost:{}/z$", LocalPortNumber); const auto RemoteBaseUri = fmt::format("http://localhost:{}/z$", RemotePortNumber); @@ -2563,7 +2568,8 @@ public: { auto& Instance = m_Instances[i]; - Instance->WaitUntilReady(); + uint16_t PortNumber = Instance->WaitUntilReady(); + CHECK_MESSAGE(PortNumber != 0, Instance->GetLogOutput()); } } |