fix(ci-visibility): reduce Go test wrapper overhead#4738
Conversation
This comment has been minimized.
This comment has been minimized.
BenchmarksBenchmark execution time: 2026-05-08 09:49:23 Comparing candidate commit 4837cb3 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 273 metrics, 2 unstable metrics, 1 flaky benchmarks without significant changes.
|
b8eb66a to
08f634b
Compare
08f634b to
4837cb3
Compare
What does this PR do?
Reduces unnecessary Go CI Visibility additional-feature wrapper usage while preserving Test Management, Early Flake Detection, Flaky Test Retry, and attempt-to-fix behavior.
This PR adds an effective additional-feature selector before
runTestWithRetryso tests only enter retry isolation when a feature can actually affect that test. It routes disabled tests without attempt-to-fix through a lightweight metadata/skip path, avoids retry wrappers for exact Test Management matches where all directive values are false, and keeps session-level additional-feature initialization intact before early returns.It also tightens feature ownership rules:
isEfdInParallelNo new environment variables are introduced; the implementation keeps using the existing internal parallel EFD flag.
Motivation
The Go CI Visibility wrapper can perturb scheduling-sensitive tests because retry-capable executions clone
testing.T, run the test body in an extra goroutine, and can add retry or parallel retry scheduling. Some tests entered that heavy path only because a feature was globally enabled or because an exact Test Management record existed, even when no active directive or effective retry budget applied to the specific test.The goal is to keep normal tests on the normal Go testing path, keep disabled tests from executing when they do not need attempt-to-fix, and avoid stacking unrelated retry behavior on top of Test Management semantics.
Testing
go test -count=1 ./internal/civisibility/integrations/gotestinggo test -count=1 ./internal/civisibility/integrations/gotesting/subtestsgo test -count=1 ./internal/civisibility/integrations/gotesting/failnowgo test -count=1 ./internal/civisibility/integrationsgo test -count=1 ./internal/envgo run ./scripts/configinverter/main.go checkgit diff --checkinternal/civisibilityorinternal/env.Reviewer's Checklist
make lintlocally.make testlocally.make generatelocally.make fix-moduleslocally.