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

[Util] Check checkpoint file exists when running state extraction #6459

Merged
merged 3 commits into from
Sep 12, 2024

Conversation

zhangchiqing
Copy link
Member

@zhangchiqing zhangchiqing commented Sep 11, 2024

When running state extraction with a wrong --execution-state-dir flag, the error message is misleading.

This PR adds check to ensure checkpoint file can be found in the specified --execution-state-dir and improved error message when a wrong or empty folder is used.

@codecov-commenter
Copy link

codecov-commenter commented Sep 11, 2024

Codecov Report

Attention: Patch coverage is 37.03704% with 17 lines in your changes missing coverage. Please review.

Project coverage is 41.45%. Comparing base (df5769f) to head (eb9e25c).

Files with missing lines Patch % Lines
cmd/util/ledger/util/state.go 0.00% 10 Missing ⚠️
cmd/util/cmd/execution-state-extract/cmd.go 58.82% 4 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6459      +/-   ##
==========================================
- Coverage   41.65%   41.45%   -0.21%     
==========================================
  Files        1974     2026      +52     
  Lines      139202   144611    +5409     
==========================================
+ Hits        57985    59944    +1959     
- Misses      75189    78468    +3279     
- Partials     6028     6199     +171     
Flag Coverage Δ
unittests 41.45% <37.03%> (-0.21%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@turbolent turbolent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@zhangchiqing zhangchiqing force-pushed the leo/util-ensure-checkpoint-exists branch from a677314 to 24d820d Compare September 12, 2024 15:27

err := ensureCheckpointFileExist(flagExecutionStateDir)
if err != nil {
log.Error().Err(err).Msgf("cannot ensure checkpoint file exist in folder %v", flagExecutionStateDir)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some test cases wants the checkpoint folder to be empty. Changed it from Fatal to Error for now.

@zhangchiqing zhangchiqing added this pull request to the merge queue Sep 12, 2024
Merged via the queue into master with commit 50e5c3a Sep 12, 2024
55 checks passed
@zhangchiqing zhangchiqing deleted the leo/util-ensure-checkpoint-exists branch September 12, 2024 21:00
This pull request was closed.
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.

5 participants