def METHOD_NAME(node: BaseNode, ks, view_name, timeout=300) -> None:
    LOGGER.info('waiting for view/index %s to be built', view_name)
    start_time = time.time()
    with (EventsFilter(  # ignore apply view errors when multiple nemesis are running scylladb/scylla-cluster-tests#6469
            event_class=DatabaseLogEvent.DATABASE_ERROR,
            regex=".*view - Error applying view update to.*",
            extra_time_to_expiration=180,
    ) if node.parent_cluster.nemesis_count > 1 else nullcontext()):
        while time.time() - start_time < timeout:
            result = node.run_nodetool(f"viewbuildstatus {ks}.{view_name}",
                                       ignore_status=True, verbose=False, publish_event=False)
            if f"{ks}.{view_name}_index has finished building" in result.stdout:
                InfoEvent(message=f"Index {ks}.{view_name} was built").publish()
            if f"{ks}.{view_name} has finished building" in result.stdout:
                InfoEvent(message=f"View/index {ks}.{view_name} was built").publish()
                return
            time.sleep(30)
    raise TimeoutError(f"Timeout error while creating view/index {view_name}. "
                       f"stdout\n: {result.stdout}\n"
                       f"stderr\n: {result.stderr}")