chore: use defer instead of t.Cleanup for chdir (#6887)

This _might_ resolve the races in `TestTemplatePush`.
This commit is contained in:
Kyle Carberry
2023-03-30 09:48:03 -05:00
committed by GitHub
parent b26f30688f
commit 1f600fc526
+1 -4
View File
@@ -178,10 +178,7 @@ func TestTemplatePush(t *testing.T) {
require.NoError(t, err)
os.Chdir(source)
t.Cleanup(func() {
os.Chdir(oldDir)
})
defer os.Chdir(oldDir)
// Don't pass the name of the template, it should use the
// directory of the source.