(t *testing.T)
| 706 | } |
| 707 | |
| 708 | func TestInternalExpiredEntriesRemoved(t *testing.T) { |
| 709 | id := fmt.Sprintf("tieer%v", time.Now().Unix()) |
| 710 | vfscommon.Opt.DirCacheTime = fs.Duration(time.Second * 4) // needs to be lower than the defined |
| 711 | rootFs, _ := runInstance.newCacheFs(t, remoteName, id, true, true, nil) |
| 712 | cfs, err := runInstance.getCacheFs(rootFs) |
| 713 | require.NoError(t, err) |
| 714 | |
| 715 | // create some rand test data |
| 716 | runInstance.writeRemoteString(t, rootFs, "one", "one content") |
| 717 | runInstance.mkdir(t, rootFs, "test") |
| 718 | runInstance.writeRemoteString(t, rootFs, "test/second", "second content") |
| 719 | |
| 720 | l, err := runInstance.list(t, rootFs, "test") |
| 721 | require.NoError(t, err) |
| 722 | require.Len(t, l, 1) |
| 723 | |
| 724 | err = cfs.UnWrap().Mkdir(context.Background(), runInstance.encryptRemoteIfNeeded(t, "test/third")) |
| 725 | require.NoError(t, err) |
| 726 | |
| 727 | l, err = runInstance.list(t, rootFs, "test") |
| 728 | require.NoError(t, err) |
| 729 | require.Len(t, l, 1) |
| 730 | |
| 731 | err = runInstance.retryBlock(func() error { |
| 732 | l, err = runInstance.list(t, rootFs, "test") |
| 733 | if err != nil { |
| 734 | return err |
| 735 | } |
| 736 | if len(l) != 2 { |
| 737 | return errors.New("list is not 2") |
| 738 | } |
| 739 | return nil |
| 740 | }, 10, time.Second) |
| 741 | require.NoError(t, err) |
| 742 | } |
| 743 | |
| 744 | func TestInternalBug2117(t *testing.T) { |
| 745 | vfscommon.Opt.DirCacheTime = fs.Duration(time.Second * 10) |
nothing calls this directly
no test coverage detected
searching dependent graphs…