Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
efd6 opened this issue May 29, 2024 · 3 comments · Fixed by #40389
Closed

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

efd6 opened this issue May 29, 2024 · 3 comments · Fixed by #40389
Assignees
Labels
flaky-test Unstable or unreliable test cases. Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team

Comments

@efd6
Copy link
Contributor

efd6 commented May 29, 2024

Flaky Test

  • Test Name: Test.test_start_stop
  • Link:
    def test_start_stop(self):
    """
    Test basic modules start and stop
    """
    self.render_config_template(
    reload=True,
    reload_path=self.working_dir + "/configs/*.yml",
    reload_type="modules",
    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/system.yml.test", 'w') as f:
    f.write(moduleConfigTemplate.format(self.working_dir + "/logs/*"))
    os.rename(self.working_dir + "/configs/system.yml.test",
    self.working_dir + "/configs/system.yml")
    with open(logfile, 'w') as f:
    f.write("Hello world\n")
    self.wait_until(lambda: self.output_lines() == 1, max_timeout=10)
    print(self.output_lines())
    # Remove input by moving the file
    # we keep it around to help debugging
    os.rename(self.working_dir + "/configs/system.yml", self.working_dir + "/configs/system.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)
    self.wait_until(lambda: self.output_lines() == 1, max_timeout=5)
    proc.check_kill_and_wait()
  • Branch: mod: update elastic/mito to version v1.12.2 #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 efd6 added flaky-test Unstable or unreliable test cases. Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team labels May 29, 2024
@elasticmachine
Copy link
Collaborator

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

@efd6
Copy link
Contributor Author

efd6 commented Jun 20, 2024

@VihasMakwana
Copy link
Contributor

VihasMakwana commented Jul 30, 2024

@efd6 this should be closed via #40237. I'll run the test CI a couple of times to be sure of it.
cc: @pierrehilbert

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flaky-test Unstable or unreliable test cases. Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants