mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: use defer instead of t.Cleanup for chdir (#6887)
This _might_ resolve the races in `TestTemplatePush`.
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user