def METHOD_NAME(tmp_path: Path):
    os.chdir(str(tmp_path))
    wf = pe.Workflow("w")
    x = make_node("x")
    x.inputs.a = 1
    x.inputs.b = 2
    y = make_node("y")
    y.inputs.a = 7
    wf.connect(x, "c", y, "b")
    z = make_node("z")
    wf.connect(y, "c", z, "a")
    z.inputs.b = 1
    v = pe.Workflow("v")
    v.add_nodes([wf])
    u = pe.Workflow("u", base_dir=Path.cwd())
    u.add_nodes([v])
    execgraph = u.run(plugin=DontRunRunner())
    def get_node(name):
        for node in execgraph.nodes():
            if node.name == name:
                return node
    x = get_node("x")
    y = get_node("y")
    z = get_node("z")
    rt = PathReferenceTracer(Path.cwd())
    for node in execgraph.nodes:
        rt.add_node(node)
    for node in execgraph.nodes:
        rt.set_node_pending(node)
    xrf = rt.node_resultfile_path(x)
    rt.set_node_complete(x, True)
    rt.set_node_complete(y, True)
    rt.set_node_complete(z, True)
    rtc = set(rt.collect())
    assert xrf.parent in rtc
    assert xrf.parent.parent in rtc
    assert xrf.parent.parent.parent in rtc
    assert xrf.parent.parent.parent.parent in rtc