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

Flaky Test [Build&Test / filebeat-macos-macosx / test_ignore_older_state_clean_inactive – filebeat.tests.system.test_registrar.Test] #22407

Closed
elasticmachine opened this issue Nov 4, 2020 · 3 comments
Assignees
Labels
ci-reported Issues that have been automatically reported from the CI flaky-test Unstable or unreliable test cases. Team:Services (Deprecated) Label for the former Integrations-Services team

Comments

@elasticmachine
Copy link
Collaborator

Flaky Test

Error details

beat.beat.TimeoutError: Timeout waiting for "cond" to be true. Waited 10 seconds.

Stack Trace

self = <test_registrar.Test testMethod=test_ignore_older_state_clean_inactive>

    def test_ignore_older_state_clean_inactive(self):
        """
        Check that state for ignore_older is not persisted when falling under clean_inactive
        """
    
        self.render_config_template(
            path=os.path.abspath(self.working_dir) + "/log/*",
            close_inactive="1s",
            clean_inactive="2s",
            ignore_older="1s",
        )
        os.mkdir(self.working_dir + "/log/")
    
        testfile_path1 = self.working_dir + "/log/test.log"
    
        with open(testfile_path1, "w") as testfile1:
            testfile1.write("Hello World\n")
    
        time.sleep(2)
    
        filebeat = self.start_beat()
    
        # Make sure file falls under ignore_older
        self.wait_until(
            lambda: self.log_contains("Ignore file because ignore_older reached"),
>           max_timeout=10)

tests/system/test_registrar.py:1247: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <test_registrar.Test testMethod=test_ignore_older_state_clean_inactive>
cond = <function Test.test_ignore_older_state_clean_inactive.<locals>.<lambda> at 0x10b818710>
max_timeout = 10, poll_interval = 0.1, name = "cond"

    def wait_until(self, cond, max_timeout=10, poll_interval=0.1, name="cond"):
        """
        Waits until the cond function returns true,
        or until the max_timeout is reached. Calls the cond
        function every poll_interval seconds.
    
        If the max_timeout is reached before cond() returns
        true, an exception is raised.
        """
        start = datetime.now()
        while not cond():
            if datetime.now() - start > timedelta(seconds=max_timeout):
                raise TimeoutError("Timeout waiting for "{}" to be true. ".format(name) +
>                                  "Waited {} seconds.".format(max_timeout))
E               beat.beat.TimeoutError: Timeout waiting for "cond" to be true. Waited 10 seconds.

../libbeat/tests/system/beat/beat.py:363: TimeoutError
@elasticmachine elasticmachine added flaky-test Unstable or unreliable test cases. ci-reported Issues that have been automatically reported from the CI labels Nov 4, 2020
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Nov 4, 2020
@jsoriano jsoriano added Team:Services (Deprecated) Label for the former Integrations-Services team and removed needs_team Indicates that the issue/PR needs a Team:* label labels Nov 6, 2020
@elasticmachine
Copy link
Collaborator Author

Pinging @elastic/integrations-services (Team:Services)

@elasticmachine
Copy link
Collaborator Author

Flaky Test

Error details

beat.beat.TimeoutError: Timeout waiting for "cond" to be true. Waited 10 seconds.

Stack Trace

self = <test_registrar.Test testMethod=test_ignore_older_state_clean_inactive>

    def test_ignore_older_state_clean_inactive(self):
        """
        Check that state for ignore_older is not persisted when falling under clean_inactive
        """
    
        self.render_config_template(
            path=os.path.abspath(self.working_dir) + "/log/*",
            close_inactive="1s",
            clean_inactive="2s",
            ignore_older="1s",
        )
        os.mkdir(self.working_dir + "/log/")
    
        testfile_path1 = self.working_dir + "/log/test.log"
    
        with open(testfile_path1, "w") as testfile1:
            testfile1.write("Hello World\n")
    
        time.sleep(2)
    
        filebeat = self.start_beat()
    
        # Make sure file falls under ignore_older
        self.wait_until(
            lambda: self.log_contains("Ignore file because ignore_older reached"),
>           max_timeout=10)

tests/system/test_registrar.py:1247: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <test_registrar.Test testMethod=test_ignore_older_state_clean_inactive>
cond = <function Test.test_ignore_older_state_clean_inactive.<locals>.<lambda> at 0x10f43bef0>
max_timeout = 10, poll_interval = 0.1, name = "cond"

    def wait_until(self, cond, max_timeout=10, poll_interval=0.1, name="cond"):
        """
        Waits until the cond function returns true,
        or until the max_timeout is reached. Calls the cond
        function every poll_interval seconds.
    
        If the max_timeout is reached before cond() returns
        true, an exception is raised.
        """
        start = datetime.now()
        while not cond():
            if datetime.now() - start > timedelta(seconds=max_timeout):
                raise TimeoutError("Timeout waiting for "{}" to be true. ".format(name) +
>                                  "Waited {} seconds.".format(max_timeout))
E               beat.beat.TimeoutError: Timeout waiting for "cond" to be true. Waited 10 seconds.

../libbeat/tests/system/beat/beat.py:363: TimeoutError

jsoriano added a commit that referenced this issue Nov 17, 2020
Skip flaky tests reported in these issues:
* #22613
* #22407
* #22612
* #22171
* #22172
jsoriano added a commit to jsoriano/beats that referenced this issue Nov 17, 2020
Skip flaky tests reported in these issues:
* elastic#22613
* elastic#22407
* elastic#22612
* elastic#22171
* elastic#22172

(cherry picked from commit 315543b)
jsoriano added a commit to jsoriano/beats that referenced this issue Nov 17, 2020
Skip flaky tests reported in these issues:
* elastic#22613
* elastic#22407
* elastic#22612
* elastic#22171
* elastic#22172

(cherry picked from commit 315543b)
jsoriano added a commit that referenced this issue Nov 18, 2020
Skip flaky tests reported in these issues:
* #22613
* #22407
* #22612
* #22171
* #22172

(cherry picked from commit 315543b)
jsoriano added a commit that referenced this issue Nov 18, 2020
Skip flaky tests reported in these issues:
* #22613
* #22407
* #22612
* #22171
* #22172

(cherry picked from commit 315543b)
@urso urso self-assigned this Dec 8, 2020
@jlind23
Copy link
Collaborator

jlind23 commented Mar 31, 2022

Backlog grooming: Closing for now.

@jlind23 jlind23 closed this as completed Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-reported Issues that have been automatically reported from the CI flaky-test Unstable or unreliable test cases. Team:Services (Deprecated) Label for the former Integrations-Services team
Projects
None yet
Development

No branches or pull requests

4 participants