-
Notifications
You must be signed in to change notification settings - Fork 240
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
Problem: there are flaky integration tests #1244
Conversation
WalkthroughThe update to the integration test script enhances the log tracking mechanism by introducing a Changes
Poem
TipsChat with CodeRabbit Bot (
|
get packet logs within range
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- integration_tests/test_ica_precompile.py (8 hunks)
Additional comments: 9
integration_tests/test_ica_precompile.py (9)
180-191: The
wait_for_packet_log
function now accepts astart
parameter to specify the starting block for log retrieval. This is a good improvement for performance and accuracy, as it narrows down the search space for logs, which can be particularly useful in a blockchain context where many blocks can be generated quickly. However, ensure that thestart
variable is correctly managed outside this function to avoid missing logs or searching from an incorrect block number.245-250: The
submit_msgs_ro
function is designed to test that read-only transactions fail as expected. This is a good practice for ensuring that the system behaves correctly in response to unauthorized actions. However, ensure that thestatus
check is indeed intended to assert failure (status == 0) and is not a mistaken assertion.248-250: The
start
variable is updated to the current block number before callingsubmit_msgs
. This is a crucial step to ensure that the log retrieval starts from the correct block after new transactions have been submitted. It's important to verify that this variable is updated at all necessary points in the test to maintain the accuracy of log retrieval.262-265: The
wait_for_packet_log
function is called after submitting messages to wait for a log with a specific sequence and status. This is a good use of the function to ensure that the expected events have occurred on-chain. However, ensure that thestatus
variable reflects the actual status of the packet (e.g.,Status.SUCCESS
) and that the sequence number matches the expected sequence.284-287: Similar to the previous comment, ensure that the
status
andsequence
are correctly asserted and that thewait_for_packet_log
function is called with the correct parameters to wait for the expected log.307-310: Here, the test expects a
Status.FAIL
after submitting messages, which is likely testing the system's behavior under failure conditions. Ensure that thestatus
is correctly set toStatus.FAIL
and that thewait_for_packet_log
function is called with the correct parameters.331-334: Again, the test is expecting a
Status.FAIL
and waits for the corresponding log. It's important to ensure that the test setup is such that a failure is indeed expected at this point, and that thewait_for_packet_log
function is called with the correct parameters.346-350: The
register_acc
function is called again, and it seems to be expected to return the sameica_address
as before. This might be testing idempotency or that the registration process does not create duplicate accounts. Ensure that this behavior is expected and correctly implemented in theregister_acc
function.362-365: The test checks that the
last_seq
matches theexpected_seq
and that thestatus
isStatus.SUCCESS
, then waits for the packet log. This is a good practice to ensure that the expected sequence of events has occurred. Ensure that thestatus
andsequence
are correctly asserted and that thewait_for_packet_log
function is called with the correct parameters.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1244 +/- ##
===========================================
- Coverage 36.89% 16.67% -20.23%
===========================================
Files 115 79 -36
Lines 10255 5786 -4469
===========================================
- Hits 3784 965 -2819
+ Misses 6097 4743 -1354
+ Partials 374 78 -296 |
6834ef9
👮🏻👮🏻👮🏻 !!!! REFERENCE THE PROBLEM YOUR ARE SOLVING IN THE PR TITLE AND DESCRIBE YOUR SOLUTION HERE !!!! DO NOT FORGET !!!! 👮🏻👮🏻👮🏻
PR Checklist:
make
)make test
)go fmt
)golangci-lint run
)go list -json -m all | nancy sleuth
)Thank you for your code, it's appreciated! :)
Summary by CodeRabbit