Skip to content

Commit

Permalink
Fix flaky symlink test on windows (#3332)
Browse files Browse the repository at this point in the history
  • Loading branch information
emcfarlane committed Sep 20, 2024
1 parent cea42e6 commit 7a0cfd1
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions private/pkg/storage/storageos/storageos_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,13 @@ func TestOS(t *testing.T) {
require.NoError(t, err)
tempDir = filepath.Join(tempDir, "sym")
require.NoError(t, os.Symlink(actualTempDir, tempDir))
t.Cleanup(func() {
if err := os.Remove(tempDir); err != nil {
t.Error(err)
}
})
provider := storageos.NewProvider(storageos.ProviderWithSymlinks())
bucket, err := provider.NewReadWriteBucket(tempDir, storageos.ReadWriteBucketWithSymlinksIfSupported())
require.NoError(t, err)

_, err = bucket.Get(ctx, "foo.txt")
foo, err := bucket.Get(ctx, "foo.txt")
require.NoError(t, err)
require.NoError(t, foo.Close())

// Try reading a file as if foo.txt is a directory.
_, err = bucket.Get(ctx, "foo.txt/bar.txt")
Expand Down

0 comments on commit 7a0cfd1

Please sign in to comment.