Skip to content
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

Merged
merged 6 commits into from
Nov 5, 2024

Conversation

kamilchodola
Copy link
Contributor

Fix scenario where nethermind stops before capturing extra logs

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a change that causes existing functionality not to work as expected)
  • Optimization
  • Refactoring
  • Documentation update
  • Build-related changes
  • Other: Tests

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

@kamilchodola kamilchodola requested review from rubo and a team as code owners November 5, 2024 09:36
@kamilchodola kamilchodola changed the title [Tests] Fix scenario where nethermind stops before capturing extra logs [Tests] Fix scenario where nethermind stops before capturing extra logs - convert script to Python Nov 5, 2024
@kamilchodola kamilchodola merged commit 001e424 into master Nov 5, 2024
76 of 77 checks passed
@kamilchodola kamilchodola deleted the kch/make_sure_exit_on_error branch November 5, 2024 13:02
Copy link
Contributor

@brbrr brbrr left a 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.

Comment on lines +35 to +45
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
Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

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?

Copy link
Contributor Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants