UT: Add note about potentially slow or racey tests

This commit is contained in:
Mike Salvatore 2022-09-14 12:11:51 -04:00
parent fbd5bb9a9e
commit d179a5563f
1 changed files with 5 additions and 0 deletions

View File

@ -13,6 +13,11 @@ def event_sender():
return BatchingAgentEventForwarder(SERVER, time_period=0.001) return BatchingAgentEventForwarder(SERVER, time_period=0.001)
# NOTE: If these tests are too slow or end up being racey, we can redesign AgentEventForwarder to
# handle threading and simply command BatchingAgentEventForwarder when to send events.
# BatchingAgentEventForwarder would have unit tests, but AgentEventForwarder would not.
def test_send_events(event_sender): def test_send_events(event_sender):
with requests_mock.Mocker() as mock: with requests_mock.Mocker() as mock:
mock.post(EVENTS_API_URL % SERVER) mock.post(EVENTS_API_URL % SERVER)