From 9e6ba92a110b141ab97b10ea6fcc0ca1bc45f0c4 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 15 Nov 2018 17:16:23 +0000 Subject: [PATCH] fstests: attempt to fix TestFsChangeNotify flakiness This now uses testPut to upload the test files which will retry on errors properly. --- fstest/fstests/fstests.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/fstest/fstests/fstests.go b/fstest/fstests/fstests.go index 03aee1414..b6ad688b7 100644 --- a/fstest/fstests/fstests.go +++ b/fstest/fstests/fstests.go @@ -1021,14 +1021,13 @@ func Run(t *testing.T, opt *Opt) { dirs = append(dirs, dir) } - contents := fstest.RandomString(100) - buf := bytes.NewBufferString(contents) - var objs []fs.Object for _, idx := range []int{2, 4, 3} { - obji := object.NewStaticObjectInfo(fmt.Sprintf("dir/file%d", idx), time.Now(), int64(buf.Len()), true, nil, nil) - o, err := remote.Put(buf, obji) - require.NoError(t, err) + file := fstest.Item{ + ModTime: time.Now(), + Path: fmt.Sprintf("dir/file%d", idx), + } + _, o := testPut(t, remote, &file) objs = append(objs, o) }