beats icon indicating copy to clipboard operation
beats copied to clipboard

filebeat/tests/system: Test.test_start_stop is failing on Windows

Open efd6 opened this issue 1 year ago • 2 comments

Flaky Test

  • Test Name: Test.test_start_stop
  • Link: https://github.com/elastic/beats/blob/f411b0624c17a034d78636c7be9c97486e75e8d8/filebeat/tests/system/test_reload_modules.py#L119-L163
  • Branch: #39755
  • ~~Artifact Link:~~
  • Notes: Additional details about the test. e.g. theory as to failure cause

Since ~~https://buildkite.com/elastic/filebeat/builds/6540~~ https://buildkite.com/elastic/filebeat/builds/6533#018fa687-8ed2-4c33-9f1d-406fdacc0a77 Test.test_start_stop has been failing on different versions of Windows, variously 2016, 2019, 2022 and 10.

https://buildkite.com/elastic?filter=beats

Stack Trace

https://buildkite.com/elastic/filebeat/builds/6615

================================== FAILURES ===================================
____________________________ Test.test_start_stop _____________________________
self = <test_reload_inputs.Test testMethod=test_start_stop>
    def test_start_stop(self):
        """
        Test basic input start and stop
        """
        self.render_config_template(
            reload=True,
            reload_path=self.working_dir + "/configs/*.yml",
            inputs=False,
        )
        proc = self.start_beat()
        os.mkdir(self.working_dir + "/logs/")
        logfile = self.working_dir + "/logs/test.log"
        os.mkdir(self.working_dir + "/configs/")
        with open(self.working_dir + "/configs/input.yml", 'w') as f:
            f.write(inputConfigTemplate.format(self.working_dir + "/logs/*"))
        with open(logfile, 'w') as f:
            f.write("Hello world\n")
        self.wait_until(lambda: self.output_lines() == 1)
        # Remove input by moving the file
        # we keep it around to help debugging
        os.rename(self.working_dir + "/configs/input.yml", self.working_dir + "/configs/input.yml.disabled")
        # Wait until input is stopped
        self.wait_until(
            lambda: self.log_contains("Stopping runner:"),
            max_timeout=15)
        with open(logfile, 'a') as f:
            f.write("Hello world\n")
        # Wait to give a change to pick up the new line (it shouldn't)
        time.sleep(1)
        proc.check_kill_and_wait()
>       assert self.output_lines() == 1
E       assert 2 == 1
E        +  where 2 = <bound method TestCase.output_lines of <test_reload_inputs.Test testMethod=test_start_stop>>()
E        +    where <bound method TestCase.output_lines of <test_reload_inputs.Test testMethod=test_start_stop>> = <test_reload_inputs.Test testMethod=test_start_stop>.output_lines

efd6 avatar May 29 '24 02:05 efd6

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

elasticmachine avatar May 29 '24 02:05 elasticmachine

https://buildkite.com/elastic/filebeat/builds/7120

efd6 avatar Jun 20 '24 01:06 efd6

@efd6 this should be closed via https://github.com/elastic/beats/issues/40237. I'll run the test CI a couple of times to be sure of it. cc: @pierrehilbert

VihasMakwana avatar Jul 30 '24 18:07 VihasMakwana