def METHOD_NAME(self):
    """
    Test stopping filebeat under load: wait for all events being published.
    """
    self.nasa_logs()
    self.render_config_template(
        path=os.path.abspath(self.working_dir) + "/log/*",
        ignore_older="1h",
        shutdown_timeout="10s",
    )
    filebeat = self.start_beat()
    # Wait until first flush
    self.wait_until(
        lambda: self.log_contains_count("Publish event") > 200,
        max_timeout=15)
    filebeat.check_kill_and_wait()
    self.get_log()
    self.wait_log_contains(
        "Shutdown output timer started.",
        max_timeout=15)
    self.wait_log_contains(
        "Continue shutdown: All enqueued events being published.",
        max_timeout=15)
    # validate registry entry offset matches last published event
    registry = self.get_registry()
    outputs = self.read_output()
    offset = registry[0]["offset"]
    assert len(registry) == 1
    # we allow for a potential race in the harvester shutdown here.
    # In some cases the registry offset might match the penultimate offset.
    eol_offset = 1
    if os.name == "nt":
        eol_offset += 1
    assert (offset == (outputs[-1]["log.offset"] + eol_offset + len(outputs[-1]["message"])) or
            offset == (outputs[-2]["log.offset"] + eol_offset + len(outputs[-2]["message"])))