Describe the bug
This agent batches logs, these batches are not always flushed. We believe this happens when the test is not run in the main thread.
Steps to Reproduce
Steps to reproduce the behavior:
Run tests in multiple threads using xdist
Expected behavior
Batches should flush, perhaps after every test?
Actual behavior
Batches would not flush, resulting in no output showing in Report Portal
Package versions
Include version info of the following packages: reportportal-client, pytest-reportportal
reportportal-client: 5.0.12
pytest-reportportal: 5.0.10
Additional context
We have found two possible work-arounds for this issue:
Either set rp_log_batch_size = 0 in pytest.ini
Or add this hook in conftest.py:
def pytest_runtest_teardown(item):
"""Workaround for an issue in Report Portal
The Report Portal agent gets confused when the test runs in parallel,
This can cause log-statements to not be successfully sent to Report Portal.
This hook ensures that the batches of logs are properly flushed for all
threads at the end of the test.
"""
# Flushes the log batch at the end of each test
if hasattr(item.config, 'py_test_service'):
item.config.py_test_service.rp.terminate()
Describe the bug This agent batches logs, these batches are not always flushed. We believe this happens when the test is not run in the main thread.
Steps to Reproduce Steps to reproduce the behavior:
Expected behavior Batches should flush, perhaps after every test?
Actual behavior Batches would not flush, resulting in no output showing in Report Portal
Package versions Include version info of the following packages: reportportal-client, pytest-reportportal
Additional context We have found two possible work-arounds for this issue:
Either set
rp_log_batch_size = 0
in pytest.iniOr add this hook in conftest.py: