[Tracing] Emit Testcase Creation events #4834
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Adding emits for
TestcaseCreationEvent
, where new testcases are created and stored into datastore. This happens during: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
andcorpus_pruning
, I leveraged some existing unit tests that already asserted the testcase creation steps. Forfuzz_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):

Event:
Actual testcase created:
Upload testcase event:


Actual testcase created: