-
Notifications
You must be signed in to change notification settings - Fork 434
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
[Tests] Fix scenario where nethermind stops before capturing extra logs - convert script to Python #7718
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.
Looks good overal, but let few minor comments for you to decide.
if found_bad_log: | ||
counter += 1 | ||
if counter >= 100: | ||
print("Exiting after capturing extra logs due to error.") | ||
sys.exit(1) | ||
continue | ||
|
||
if any(bad_log in line for bad_log in bad_logs): | ||
print(f"Error: Found bad log in line: {line.strip()}") | ||
found_bad_log = True | ||
continue |
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.
Not sure I understand why it's implemented this way. From my understanding:
When a bad log is found, we'll set the flag to true;
After that, we'll run the for loop 100 more times, and then exit.
Is it used to capture extra logs?
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.
Yes exactly for this purpose
@@ -0,0 +1,63 @@ | |||
import os |
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.
Not sure, but was wondering if we could reuse the script from post-merge tests, what do you think? Probably not needed at this point, I guess?
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.
I reached the limit of optimizing to various ise cases SH script and python gave me more flexibility and went quickly with rewrite.
I have no issue reusing existing one and keep them identical to some extent!
Fix scenario where nethermind stops before capturing extra logs
Types of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?