Skip to content

Commit

Permalink
test: Adjust timings for test_logger.py
Browse files Browse the repository at this point in the history
  • Loading branch information
bahlo committed Sep 30, 2024
1 parent 9cabec7 commit 4d34bf3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/test_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_log(self):
dataset_name, "A dataset to test axiom-py logger"
)

axiom_handler = AxiomHandler(client, dataset_name, interval=0.5)
axiom_handler = AxiomHandler(client, dataset_name, interval=1.0)

logger = logging.getLogger()
logger.addHandler(axiom_handler)
Expand All @@ -38,6 +38,9 @@ def test_log(self):
# Flush events
axiom_handler.flush()

# Wait a bit for the ingest to finish
time.sleep(0.5)

# Now we should have a log
res = client.apl_query(dataset_name)
self.assertEqual(1, res.status.rowsExamined)
Expand All @@ -46,8 +49,8 @@ def test_log(self):
"This log should be ingested without any subsequent call"
)

# Sleep a bit to wait for the background flush.
time.sleep(1.0)
# Wait for the background flush.
time.sleep(1.5)

# Now we should have two logs
res = client.apl_query(dataset_name)
Expand Down

0 comments on commit 4d34bf3

Please sign in to comment.