Skip to content

FIX Enable testcase uploading during pruning #4825

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

vitaliset
Copy link
Collaborator

b/421159107

@vitaliset vitaliset changed the title FIX Fix testcase uploading during pruning FIX Enable testcase uploading during pruning Jun 24, 2025
@vitaliset vitaliset requested a review from ViniciustCosta June 25, 2025 00:04
ViniciustCosta added a commit that referenced this pull request Jun 25, 2025
## Description
Adding emits for `TestcaseCreationEvent`, where new testcases are
created and stored into datastore. This happens during:
* upload_testcase (manual upload)
* corpus_pruning_task
* fuzz_task

Note: For Corpus Pruning, the feature of uploading testcases for crashes
found during pruning is commented out (this is being tracked and fixed
at #4825). Thus, both the
event emission and the unit tests are disabled. I enabled it locally and
ran the unit tests, which completed successfully.

As referenced in our tracing design doc, "Testcase Creation" section.
b/394048114

## Tests
#### Unit tests
Added unit tests to guarantee that the events are correctly emitted when
a testcase is created in all these contexts. For `upload_testcase` and
`corpus_pruning`, I leveraged some existing unit tests that already
asserted the testcase creation steps. For `fuzz_task`, it was necessary
to create a new test in order to call the testcase creation method and
assert the event emission.

#### Runtime tests
For runtime tests, since it is difficult to actually trigger these code
paths locally, I intend to deploy to our dev/staging environments and
monitor the events. Evidence of events being emitted in dev:
* Fuzz task ([link to logs creating
testcase](https://pantheon.corp.google.com/logs/query;cursorTimestamp=2025-06-25T15:19:40.084565Z;duration=PT3H;query=jsonPayload.extras.clusterfuzz_version%3D%2234abee68%22%0AjsonPayload.extras.task_name%3D%22fuzz%22%0AjsonPayload.extras.stage%3D%22postprocess%22%0Atimestamp%3D%222025-06-25T15:19:40.084565Z%22%0AinsertId%3D%22e683gef6i7ak9%22?project=clusterfuzz-development)):
Event:
![image](https://github.com/user-attachments/assets/883a262e-659e-4789-aa26-83786f5230ce)
Actual testcase created: 

![image](https://github.com/user-attachments/assets/5f6963f2-2d85-48b5-b09a-9b86d6e66275)

* Upload testcase event:

![image](https://github.com/user-attachments/assets/e33e0573-e7d4-434f-a480-a2be1d7bd764)
Actual testcase created:

![image](https://github.com/user-attachments/assets/b13a5a79-eb83-465e-8c18-82ee0b44c826)
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.

2 participants