mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-29 01:58:14 +00:00
pytest improvements to handle flaky test (#2726)
* build(dev): add pytest-randomly dependency By randomizing the test execution order, this helps identify tests that unintentionally depend on shared state or specific execution order, which can lead to flaky or unreliable test behavior. * build(dev): add pytest-timeout This will prevent a test from running indefinitely * test: block external requests in CI and set default 10s timeout per test * test: adding missing cassettes We notice that those cassettes are missing after enabling block-network on CI * test: increase tests timeout on CI * test: fix flaky test ValueError: Circular reference detected (id repeated) * fix: prevent crash when event handler raises exception Previously, if a registered event handler raised an exception during execution, it could crash the entire application or interrupt the event dispatch process. This change wraps handler execution in a try/except block within the `emit` method, ensuring that exceptions are caught and logged without affecting other handlers or flow. This improves the resilience of the event bus, especially when handling third-party or temporary listeners.
This commit is contained in:
1899
tests/cassettes/test_docling_source.yaml
Normal file
1899
tests/cassettes/test_docling_source.yaml
Normal file
File diff suppressed because it is too large
Load Diff
3321
tests/cassettes/test_multiple_docling_sources.yaml
Normal file
3321
tests/cassettes/test_multiple_docling_sources.yaml
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user