def METHOD_NAME(agent_host, clean_environment):
    '''
    description: Check that after a long time when the manager has been unable to synchronize de databases, because
    new agents are being continually added, database synchronization is forced and the expected information is in
    all nodes after the expected sync time.
    wazuh_min_version: 4.4.0
    parameters:
        - agent_host:
            type: List
            brief: Name of the host where the agent will register en each case.
        - clean_enviroment:
            type: Fixture
            brief: Reset the wazuh log files at the start of the test. Remove all registered agents from master.
    assertions:
        - Verify that after registering and after starting the agent, the indicated group is synchronized.
    expected_output:
        - The 'Agent_name' with ID 'Agent_id' belongs to groups: 'group_name'.
    '''
    # Create all groups
    for group in agent_groups:
        create_new_agent_group(test_infra_managers[0], group, host_manager)
    # Register agents with their groups in manager
    agent_data = []
    for index, agent in enumerate(test_infra_agents):
        data = register_agent(agent, agent_host, host_manager, agent_groups[index])
        agent_data.append(data)
    # get the time before all the process is started
    time_before = time.time()
    end_time = time_before + test_time
    active_agent = 0
    while time.time() < end_time:
        if active_agent < agents_in_cluster:
            host_manager.run_command(test_infra_agents[active_agent], f'{WAZUH_PATH}/bin/wazuh-control start')
            active_agent = active_agent + 1
    assert active_agent == agents_in_cluster, f"Unable to restart all agents in the expected time. \
                                                Agents restarted: {active_agent}"
    time.sleep(sync_delay)
    # Check that agent has the expected group assigned in all nodes
    for index, agent in enumerate(agent_data):
        data = agent_data[index]
        check_agent_groups(data[1], agent_groups[index], test_infra_managers, host_manager)