def METHOD_NAME(pav_cfg, tests_dir: Path) -> set:
    """Generate a set of all build paths currently used by one or more test
    runs."""
    used_builds = set()
    for path in dir_db.select(pav_cfg, tests_dir).paths:
        build_origin_symlink = path/'build_origin'
        build_origin = None
        if (build_origin_symlink.exists() and
                build_origin_symlink.is_symlink() and
                build_origin_symlink.resolve().exists()):
            build_origin = build_origin_symlink.resolve()
        if build_origin is not None:
            used_builds.add(build_origin.name)
    return used_builds