(t *testing.T)
| 742 | } |
| 743 | |
| 744 | func TestInternalBug2117(t *testing.T) { |
| 745 | vfscommon.Opt.DirCacheTime = fs.Duration(time.Second * 10) |
| 746 | |
| 747 | id := fmt.Sprintf("tib2117%v", time.Now().Unix()) |
| 748 | rootFs, _ := runInstance.newCacheFs(t, remoteName, id, false, true, map[string]string{"info_age": "72h", "chunk_clean_interval": "15m"}) |
| 749 | |
| 750 | if runInstance.rootIsCrypt { |
| 751 | t.Skipf("skipping crypt") |
| 752 | } |
| 753 | |
| 754 | cfs, err := runInstance.getCacheFs(rootFs) |
| 755 | require.NoError(t, err) |
| 756 | |
| 757 | err = cfs.UnWrap().Mkdir(context.Background(), "test") |
| 758 | require.NoError(t, err) |
| 759 | for i := 1; i <= 4; i++ { |
| 760 | err = cfs.UnWrap().Mkdir(context.Background(), fmt.Sprintf("test/dir%d", i)) |
| 761 | require.NoError(t, err) |
| 762 | |
| 763 | for j := 1; j <= 4; j++ { |
| 764 | err = cfs.UnWrap().Mkdir(context.Background(), fmt.Sprintf("test/dir%d/dir%d", i, j)) |
| 765 | require.NoError(t, err) |
| 766 | |
| 767 | runInstance.writeObjectString(t, cfs.UnWrap(), fmt.Sprintf("test/dir%d/dir%d/test.txt", i, j), "test") |
| 768 | } |
| 769 | } |
| 770 | |
| 771 | di, err := runInstance.list(t, rootFs, "test/dir1/dir2") |
| 772 | require.NoError(t, err) |
| 773 | fs.Logf(nil, "len: %v", len(di)) |
| 774 | require.Len(t, di, 1) |
| 775 | |
| 776 | time.Sleep(time.Second * 30) |
| 777 | |
| 778 | di, err = runInstance.list(t, rootFs, "test/dir1/dir2") |
| 779 | require.NoError(t, err) |
| 780 | fs.Logf(nil, "len: %v", len(di)) |
| 781 | require.Len(t, di, 1) |
| 782 | |
| 783 | di, err = runInstance.list(t, rootFs, "test/dir1") |
| 784 | require.NoError(t, err) |
| 785 | fs.Logf(nil, "len: %v", len(di)) |
| 786 | require.Len(t, di, 4) |
| 787 | |
| 788 | di, err = runInstance.list(t, rootFs, "test") |
| 789 | require.NoError(t, err) |
| 790 | fs.Logf(nil, "len: %v", len(di)) |
| 791 | require.Len(t, di, 4) |
| 792 | } |
| 793 | |
| 794 | // run holds the remotes for a test run |
| 795 | type run struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…