Repository navigation
chore: speed up Go tests and fix Datastore emulator leaks - #6231
Merged
michaelkedar merged 1 commit intoOct 26, 2026
Merged
Conversation
Ly-Joey
approved these changes
Oct 26, 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.
Speeds up local and CI Go test execution and fixes leaked Datastore emulator processes:
go/testutils/datastore.go):StartDatastoreEmulator(t)registeredt.Cleanupinsidesync.Once, which ran after the first test function finished and only killed the parentgcloudPython process—leaving the childbashwrapper andjavaCloudFirestoreemulator running as orphaned background processes aftergo testexited.StartDatastoreEmulator(t)withRunWithDatastoreEmulator(m *testing.M)(called fromTestMainincmd/relations,internal/database/datastore, andinternal/recoverer), running the emulator in its own process group (Setpgid: true) so the entire process tree is cleanly terminated when the package tests finish.net.DialTimeoutto HTTPGET /(200 OK) and added a request timeout toresetEmulatorsoPOST /resetcannot hang before Jetty's HTTP handler is ready.go/internal/repospackage:go/internal/reposwas unused across the codebase and was the sole importer ofgithub.com/go-git/go-git/v6(and 9 transitive dependencies) ingo/go.mod.go-vcrreplay latency simulation:recorder.WithSkipRequestLatency(true)ingo/testutils/vcr.goandvulnfeeds/internal/testutils/testutils.goso VCR cassette tests don't sleep for recorded HTTP response durations during replay (droppinggo/osv/ecosystemfrom ~6.8s to ~0.17s).machineType: E2_HIGHCPU_8ingo/cloudbuild.yamlandvulnfeeds/cloudbuild.yaml(matchingosv/cloudbuild.yaml) instead of the default 1-vCPUe2-mediumVM.docker/ci/install_go.shtogo1.27.1to matchgo.mod.agy