nydus
nydus copied to clipboard
nydus-test: a race condition randonly causes integration test failures
Seems the generated test file set may not containers hardlinks dist.hardlinks.values())[1][0]
=================================== FAILURES =================================== _______________________ test_certain_files_prefetch[fs] ________________________
nydus_anchor = <nydus_anchor.NydusAnchor object at 0x7f6f568287f0> nydus_scratch_image = <rafs.RafsImage object at 0x7f6f56829f60> prefetch_policy = 'fs'
@pytest.mark.parametrize("prefetch_policy", ["fs"])
def test_certain_files_prefetch(
nydus_anchor: NydusAnchor, nydus_scratch_image: RafsImage, prefetch_policy
):
"""
description:
For rafs, there are two types of prefetching.
1. Prefetch files from fs-layer, which means each file is prefetched one by one.
2. Prefetch directly from backend/blob layer, which means a range will be fetched from blob
"""
dist = Distributor(nydus_scratch_image.rootfs(), 8, 2)
dist.generate_tree()
dist.put_directories(20)
dist.put_multiple_files(100, Size(64, Unit.KB))
dist.put_symlinks(8)
dist.put_hardlinks(8)
dist.put_multiple_files(40, Size(64, Unit.KB))
hint_files = dist.files[-20:]
hint_files.extend(dist.symlinks[-6:])
hint_files.append(list(dist.hardlinks.values())[1][0])
E IndexError: list index out of range
Did this problem happen on the master HEAD or stable branches?
It has been observed on master branch, not sure about the 2.1 branch. https://github.com/dragonflyoss/image-service/actions/runs/3963574141/jobs/6791556531
@jiangliu Hi, does this issue still exist? If not we could close it.
The issue has been fixed in latest smoke test.