diff --git a/swh/fuse/fuse.py b/swh/fuse/fuse.py --- a/swh/fuse/fuse.py +++ b/swh/fuse/fuse.py @@ -71,6 +71,11 @@ except KeyError: pass + try: + pyfuse3.invalidate_inode(inode) + except FileNotFoundError: + pass + def inode2entry(self, inode: int) -> FuseEntry: """ Return the entry matching a given inode """ diff --git a/swh/fuse/tests/test_revision.py b/swh/fuse/tests/test_revision.py --- a/swh/fuse/tests/test_revision.py +++ b/swh/fuse/tests/test_revision.py @@ -72,9 +72,16 @@ assert depth2 in (os.listdir(dir_by_page / depth1)) dir_by_date = dir_path / "by-date" - # TODO: rely on .status file instead to wait - # Wait 2 seconds to populate by-date/ dir - time.sleep(2) + finished = False + # Wait max 2 seconds to populate by-date/ dir + for i in range(200): + entries = os.listdir(dir_by_date) + if entries and ".status" not in entries: + finished = True + break + time.sleep(0.1) + assert finished + for swhid in expected: meta = get_data_from_web_archive(str(swhid)) date = dateutil.parser.parse(meta["date"])