Skip to content

Commit b306faa

Browse files
bmehta001Copilot
andcommitted
Fix MultipleLogManagersTests: atomic counter and relaxed timeouts
- Make RequestHandler::m_count atomic to fix data race between server thread (writing) and test thread (reading). - Increase wait timeouts from 10s to 20s to accommodate slow CI simulators where NSURLSession connection setup can be delayed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 86ba37c commit b306faa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/functests/MultipleLogManagersTests.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class RequestHandler : public HttpServer::Callback
5454
}
5555

5656
private:
57-
size_t m_count {};
57+
std::atomic<size_t> m_count {};
5858
int m_id ;
5959
};
6060

@@ -196,7 +196,7 @@ TEST_F(MultipleLogManagersTests, ThreeInstancesCoexist)
196196
lm2->GetLogController()->UploadNow();
197197
lm3->GetLogController()->UploadNow();
198198

199-
waitForRequestsMultipleLogManager(10000, 1, 1, 1);
199+
waitForRequestsMultipleLogManager(20000, 1, 1, 1);
200200

201201
lm1.reset();
202202
lm2.reset();
@@ -224,7 +224,7 @@ TEST_F(MultipleLogManagersTests, MultiProcessesLogManager)
224224
CAPTURE_PERF_STATS("Events Sent");
225225
lm->GetLogController()->UploadNow();
226226
CAPTURE_PERF_STATS("Events Uploaded");
227-
waitForRequestsSingleLogManager(10000, 2);
227+
waitForRequestsSingleLogManager(20000, 2);
228228
lm.reset();
229229
CAPTURE_PERF_STATS("Log Manager deleted");
230230
}

0 commit comments

Comments
 (0)