var overrideLock … var featureFlagOverride … var emulationVersionOverride … var emulationVersionOverrideValue … func init() { … } // SetFeatureGateDuringTest sets the specified gate to the specified value for duration of the test. // Fails when it detects second call to the same flag or is unable to set or restore feature flag. // // WARNING: Can leak set variable when called in test calling t.Parallel(), however second attempt to set the same feature flag will cause fatal. // // Example use: // // featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.<FeatureName>, true) func SetFeatureGateDuringTest(tb TB, gate featuregate.FeatureGate, f featuregate.Feature, value bool) { … } // featuregatetesting.SetFeatureGateEmulationVersionDuringTest(t, utilfeature.DefaultFeatureGate, version.MustParse("1.31")) func SetFeatureGateEmulationVersionDuringTest(tb TB, gate featuregate.FeatureGate, ver *version.Version) { … } func detectParallelOverride(tb TB, f featuregate.Feature) func() { … } func detectParallelOverrideEmulationVersion(tb TB, ver *version.Version) func() { … } func sameTestOrSubtest(tb TB, testName string) bool { … } type TB …