You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ FOOBAR=123 go test -v .
=== RUN TestFoo
--- PASS: TestFoo (0.00s)
PASS
ok envtest 0.142s
$ FOOBAR=1234 go test -v .
=== RUN TestFoo
--- PASS: TestFoo (0.00s)
PASS
ok envtest (cached)
What did you expect to see?
The second test run should fail.
What did you see instead?
The call to os.Getenv did not properly factor into the cache, so it incorrectly reported the cached result.
Note that calling os.Getenv directly inside the unit test works correctly.
$ FOOBAR=123 go test -v .
=== RUN TestFoo
--- PASS: TestFoo (0.00s)
PASS
ok envtest 0.152s
$ FOOBAR=1234 go test -v .
=== RUN TestFoo
--- FAIL: TestFoo (0.00s)
FAIL
FAIL envtest 0.128s
FAIL
The text was updated successfully, but these errors were encountered:
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes (1.20.3)
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
The second test run should fail.
What did you see instead?
The call to
os.Getenv
did not properly factor into the cache, so it incorrectly reported the cached result.Note that calling
os.Getenv
directly inside the unit test works correctly.The text was updated successfully, but these errors were encountered: