mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-11 00:58:30 +00:00
fix: address flaky tests (#3363)
Some checks failed
Notify Downstream / notify-downstream (push) Has been cancelled
Some checks failed
Notify Downstream / notify-downstream (push) Has been cancelled
fix: resolve flaky tests and race conditions in test suite - Fix telemetry/event tests by patching class methods instead of instances - Use unique temp files/directories to prevent CI race conditions - Reset singleton state between tests - Mock embedchain.Client.setup() to prevent JSON corruption - Rename test files to test_*.py convention - Move agent tests to tests/agents directory - Fix repeated tool usage detection - Remove database-dependent tools causing initialization errors
This commit is contained in:
@@ -79,8 +79,10 @@ def test_telemetry_fails_due_connect_timeout(export_mock, logger_mock):
|
||||
|
||||
trace.get_tracer_provider().force_flush()
|
||||
|
||||
export_mock.assert_called_once()
|
||||
logger_mock.assert_called_once_with(error)
|
||||
assert export_mock.called
|
||||
assert logger_mock.call_count == export_mock.call_count
|
||||
for call in logger_mock.call_args_list:
|
||||
assert call[0][0] == error
|
||||
|
||||
|
||||
@pytest.mark.telemetry
|
||||
|
||||
Reference in New Issue
Block a user