def METHOD_NAME(layout: str, all_buckets_env: str) -> None:
    if layout:
        os.environ['DESTINATION__FILESYSTEM__LAYOUT'] = layout
    else:
        os.environ.pop("DESTINATION__FILESYSTEM__LAYOUT", None)
    dataset_name = 'test_' + uniq_id()
    # NOTE: context manager will delete the dataset at the end so keep it open until the end
    with perform_load(dataset_name, NORMALIZED_FILES, write_disposition='replace') as load_info:
        client, _, root_path, load_id1 = load_info
        layout = client.config.layout
        # this path will be kept after replace
        job_2_load_1_path = posixpath.join(
            root_path,
            LoadFilesystemJob.make_destination_filename(layout, NORMALIZED_FILES[1], client.schema.name, load_id1)
        )
        with perform_load(dataset_name, [NORMALIZED_FILES[0]], write_disposition='replace') as load_info:
            client, _, root_path, load_id2 = load_info
            # this one we expect to be replaced with
            job_1_load_2_path = posixpath.join(
                root_path,
                LoadFilesystemJob.make_destination_filename(layout, NORMALIZED_FILES[0], client.schema.name, load_id2)
            )
            # First file from load1 remains, second file is replaced by load2
            # assert that only these two files are in the destination folder
            paths = []
            for basedir, _dirs, files  in client.fs_client.walk(client.dataset_path, detail=False, refresh=True):
                for f in files:
                    paths.append(posixpath.join(basedir, f))
            ls = set(paths)
            assert ls == {job_2_load_1_path, job_1_load_2_path}