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

Upload also the realm file when the fuzzer fails #7700

Merged
merged 3 commits into from
May 21, 2024

Conversation

nicola-cab
Copy link
Member

What, How & Why?

Upload also the realm file if the fuzzer fails, in order to reply the fuzzer locally using the input crash file and apply it to the same input file.

☑️ ToDos

  • 📝 Changelog update
  • 🚦 Tests (or not relevant)
  • C-API, if public C++ API changed
  • bindgen/spec.yml, if public C++ API changed

@nicola-cab nicola-cab requested review from jbreams and michael-wb May 16, 2024 16:46
@cla-bot cla-bot bot added the cla: yes label May 16, 2024
@nicola-cab nicola-cab added no-jira-ticket Skip checking the PR title for Jira reference no-changelog labels May 16, 2024
@jbreams jbreams requested review from jsflax and removed request for jbreams May 16, 2024 17:02
Copy link

coveralls-official bot commented May 16, 2024

Pull Request Test Coverage Report for Build nicola.cabiddu_1721

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 126 unchanged lines in 20 files lost coverage.
  • Overall coverage decreased (-0.03%) to 90.797%

Files with Coverage Reduction New Missed Lines %
src/realm/index_string.cpp 1 84.63%
src/realm/index_string.hpp 1 93.48%
src/realm/query_expression.hpp 1 93.81%
src/realm/sort_descriptor.cpp 1 94.06%
src/realm/sync/noinst/server/server_history.cpp 1 63.7%
src/realm/util/file.cpp 1 78.73%
src/realm/table_view.cpp 2 92.99%
test/test_all.cpp 2 74.12%
src/realm/sync/client.cpp 3 89.73%
src/realm/sync/noinst/protocol_codec.hpp 3 74.03%
Totals Coverage Status
Change from base Build 2310: -0.03%
Covered Lines: 214522
Relevant Lines: 236265

💛 - Coveralls

@nicola-cab
Copy link
Member Author

bump @michael-wb and @jsflax

@@ -431,6 +431,7 @@ functions:
if ls crash-*> /dev/null 2>&1; then
echo "Found crash file"
mv crash-* realm-fuzzer-crash.txt
mv fuzz-test.realm fuzzer_realm.realm
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are you renaming the file from fuzz-test.realm to fuzzer_realm.realm and then back after it has been uploaded?
Was there a problem uploading the file with the original filename?
Or, if you are trying to rename the file that is uploaded, you can use the remote_file parameter to specify the new file name when it is uploaded instead of renaming the file explicitly.

Copy link
Member Author

Choose a reason for hiding this comment

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

In theory, the realm file we use for the fuzzer is never deleted, so it is always reused (cycle after cycle). If I got a crash file, I know there is a crash, so I am uploading the crash report and the realm, in order to avoid uploading for every cycle the realm file, I am just renaming it.
I am not sure, if there is a better strategy. So essentially, I only need to upload the file if there is a failure.

Comment on lines 457 to 458
local_file: 'realm-core/build/test/realm-fuzzer/fuzz-realm.realm'
remote_file: '${project}/${branch_name}/${task_id}/${execution}/fuzz-realm.realm'
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to be fuzzer_realm.realm, since you just renamed the file

Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch.

Copy link
Contributor

@michael-wb michael-wb left a comment

Choose a reason for hiding this comment

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

LGTM - thanks for making the updates

@nicola-cab nicola-cab merged commit 4b38b44 into master May 21, 2024
37 checks passed
@nicola-cab nicola-cab deleted the nc/try_upload_realm_file_when_fuzzer_fails branch May 21, 2024 13:18
@fealebenpae fealebenpae mentioned this pull request May 23, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes no-changelog no-jira-ticket Skip checking the PR title for Jira reference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants