Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Sep 22, 2023
1 parent 81f47de commit 74d6bc5
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions tests/core/test_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,27 +44,23 @@ def test_worker_continue_working_on_request_error():
http_fail = HttpRequest(
fail_session, LOG_REQUEST_URL, files=log_batch.payload,
verify_ssl=False)
log_batch.http_request = http_fail
worker.send(log_batch)
worker.send(http_fail)

start_time = time.time()
while fail_session.call_count < 1 and time.time() - start_time < 10:
time.sleep(0.1)

assert fail_session.call_count == 1
assert log_batch.response is None

pass_session = mock.Mock()
http_pass = HttpRequest(
pass_session, LOG_REQUEST_URL, files=log_batch.payload,
verify_ssl=False)
log_batch.http_request = http_pass
worker.send(log_batch)
worker.send(http_pass)

start_time = time.time()
while pass_session.call_count < 1 and time.time() - start_time < 10:
time.sleep(0.1)

assert pass_session.call_count == 1
assert log_batch.response
worker.stop()

0 comments on commit 74d6bc5

Please sign in to comment.