-
Notifications
You must be signed in to change notification settings - Fork 166
feat(consume): enable logging, propagate logs to hive results #1361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds logging capabilities to help debug timing issues in simulator and client interactions by propagating logs to hive test results and configuring more concise tracebacks.
- Use pytest’s
--tb short
for cleaner tracebacks. - Introduce a new logging plugin to add timestamps and per-worker log files.
- Propagate captured stdout/stderr into test result details for hiveview.
Reviewed Changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
src/pytest_plugins/pytest_hive/pytest_hive.py | Adjusts test reporting to include captured output and modifies how test details are aggregated. |
src/pytest_plugins/logging.py | Introduces a logging plugin that creates per-worker log files with UTC timestamps and colorful terminal output. |
src/pytest_plugins/consume/hive_simulators/rlp/test_via_rlp.py | Adds logging statements before RPC calls and improves assertion messages for clarity. |
src/pytest_plugins/consume/hive_simulators/conftest.py | Inserts logging calls to mark the lifecycle events of clients. |
Files not reviewed (2)
- pytest-consume.ini: Language not supported
- whitelist.txt: Language not supported
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This must have been hard to get working! Really happy to have this. Minor comments below :)
Assuming consume engine
additions in another PR?
Co-authored-by: spencer <[email protected]>
Co-authored-by: Copilot <[email protected]>
@spencer-tb We should probably add a couple here for good measure. I was hoping to do a fast follow-up PR with rpc call retries, in which case the logging will require re-writing anyway. But let's get them in here, it's only a few mins. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments, or just like questions in general, but overall looks pretty good.
The `get_logger()` helper function enables typechecking for our custom log-levels without the need for devs to explicitly cast to `EESTLogger` every time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I think we could improve this in the future, by adding fill
for example, but as of now seems good to go. Thanks!
I've debugged the unit test fail and funnily enough, it does not fail when you select the failing test only:
passes all tests, but doing:
makes them fail. |
Thanks so much for starting to debug this, I was confused about the CI fail as I was sure that I fixed it locally. Should be sorted now. |
…um#1361) Co-authored-by: spencer <[email protected]>
🗒️ Description
The Besu Team reported some flaky looking
eest/consume-rlp
results in the Pectra dashboard, without any logging from the simulator side, we're essentially blind as to the timing of the simulator setup with regards to client startup. This PR adds logging to help debug this.Changes
--tb short
to only show relevant tracebacks for unexpected exceptions in test execution (e.g., timeout on rpc call; requests exceptions are notoriously noisy).a. Getting timestamps in pytest's capd output (pytest has amazing logging, but this seemed unachievable with the built-in plugin, would be happy to be wrong).
b. Clean logging to file per logger with xdist.
c. Adding log lines to the file for start and end of test.
Example of Hiveview test case fail
Still with a bug; setup stdout is duplicated in call stdout.

Example of Hiveview test case pass
With bug fix (setup stdout no longer duplicated to call stdout).

Example of file logging
Example of console logging with fail
Pytest provides this out the box, but without timestamps 😭

🔗 Related Issues
✅ Checklist