Repository navigation
feat(taskrecord): introduce DAG task record and replay test framework - #924
Merged
Merged
Conversation
kyasbal
requested review from
K53,
RyuSA,
jyane,
kkuchima and
renamoo
as code owners
August 30, 2026 23:52
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a task record and replay framework for benchmarking and profiling KHI DAG tasks, including a detailed guide, test flags, utility files, tests, and GCS sync scripts. The review feedback highlights critical issues in the replay interceptor, specifically a deadlock risk on panic or early return due to missing state cleanup, and high profiling overhead/file truncation from running profiling on every benchmark iteration. The reviewer suggested using defer blocks for state cleanup and managing profiling initialization and cleanup exactly once using sync.Once and t.Cleanup.
kyasbal
commented
Aug 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Introduces the
taskrecordtest utility framework, enabling recording and replaying of DAG task outputs for isolated unit testing, regression testing, and microbenchmarks.Key Changes
pkg/testutil/taskrecord/codec.go): Serializes/deserializes task results with gzip compression.pkg/testutil/taskrecord/harness.go,recorder.go,replayer.go):JobTestHarness: Runs tasks in record mode or replay mode using recorded fixtures.internal/testflags): Adds-record-task-result,-replay-task-result, and-fixture-dirtest flags..agents/skills/task_record_replay/SKILL.mddocumenting fixture usage and pprof profiling recipes.make sync-task-fixturesinscripts/make/testing.mk.googlecloudlogk8saudit/impl/parser_test.go.Verification
go test ./pkg/testutil/taskrecord/... ./internal/testflags/...