From 5d94ad9ae02ef7e7fa4841a505eb6acf48093815 Mon Sep 17 00:00:00 2001 From: Will Hegedus Date: Mon, 12 May 2025 07:47:12 -0400 Subject: [PATCH] test(cmd): enable test cases for GOGC environment variable Signed-off-by: Will Hegedus --- cmd/prometheus/main_test.go | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/cmd/prometheus/main_test.go b/cmd/prometheus/main_test.go index eb96b6fa96..34b026be91 100644 --- a/cmd/prometheus/main_test.go +++ b/cmd/prometheus/main_test.go @@ -685,12 +685,11 @@ func TestRuntimeGOGCConfig(t *testing.T) { name: "empty config file", expectedGOGC: 75, }, - // the GOGC env var is ignored in this case, see https://github.com/prometheus/prometheus/issues/16334 - /* { + { name: "empty config file with GOGC env var set", gogcEnvVar: "66", expectedGOGC: 66, - }, */ + }, { name: "gogc set through config", config: ` @@ -719,15 +718,14 @@ runtime:`, gogcEnvVar: "88", expectedGOGC: 88, }, - // the GOGC env var is ignored in this case, see https://github.com/prometheus/prometheus/issues/16334 - /* { - name: "unrelated config and GOGC env var set", - config: ` - global: - scrape_interval: 500ms`, - gogcEnvVar: "80", - expectedGOGC: 80, - }, */ + { + name: "unrelated config and GOGC env var set", + config: ` +global: + scrape_interval: 500ms`, + gogcEnvVar: "80", + expectedGOGC: 80, + }, } { t.Run(tc.name, func(t *testing.T) { t.Parallel()