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

Fix flaky logstash output test #43402

Merged
merged 2 commits into from
Mar 24, 2025
Merged

Conversation

faec
Copy link
Contributor

@faec faec commented Mar 20, 2025

Fix a flaky logstash output test for the deadlockListener. The old test used live time tickers and occasionally failed because timing on CI machines is highly variable. This PR refactors deadlockListener to allow tests to override the current time and the ticker channel, so the test can run deterministically in a single goroutine with no calls to time.Sleep.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

@faec faec added flaky-test Unstable or unreliable test cases. Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team backport-active-all Automated backport with mergify to all the active branches labels Mar 20, 2025
@faec faec self-assigned this Mar 20, 2025
@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Mar 20, 2025
@faec faec marked this pull request as ready for review March 20, 2025 21:05
@faec faec requested a review from a team as a code owner March 20, 2025 21:05
@faec faec requested review from AndersonQ and belimawr March 20, 2025 21:05
@elasticmachine
Copy link
Collaborator

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

@faec
Copy link
Contributor Author

faec commented Mar 24, 2025

/test

@faec faec merged commit 6d92a40 into elastic:main Mar 24, 2025
147 checks passed
mergify bot pushed a commit that referenced this pull request Mar 24, 2025
Fix a flaky logstash output test for the `deadlockListener`. The old test used live time tickers and occasionally failed because timing on CI machines is highly variable. This PR refactors `deadlockListener` to allow tests to override the current time and the ticker channel, so the test can run deterministically in a single goroutine with no calls to `time.Sleep`.

(cherry picked from commit 6d92a40)
mergify bot pushed a commit that referenced this pull request Mar 24, 2025
Fix a flaky logstash output test for the `deadlockListener`. The old test used live time tickers and occasionally failed because timing on CI machines is highly variable. This PR refactors `deadlockListener` to allow tests to override the current time and the ticker channel, so the test can run deterministically in a single goroutine with no calls to `time.Sleep`.

(cherry picked from commit 6d92a40)
mergify bot pushed a commit that referenced this pull request Mar 24, 2025
Fix a flaky logstash output test for the `deadlockListener`. The old test used live time tickers and occasionally failed because timing on CI machines is highly variable. This PR refactors `deadlockListener` to allow tests to override the current time and the ticker channel, so the test can run deterministically in a single goroutine with no calls to `time.Sleep`.

(cherry picked from commit 6d92a40)

# Conflicts:
#	libbeat/outputs/logstash/deadlock.go
#	libbeat/outputs/logstash/deadlock_test.go
mergify bot pushed a commit that referenced this pull request Mar 24, 2025
Fix a flaky logstash output test for the `deadlockListener`. The old test used live time tickers and occasionally failed because timing on CI machines is highly variable. This PR refactors `deadlockListener` to allow tests to override the current time and the ticker channel, so the test can run deterministically in a single goroutine with no calls to `time.Sleep`.

(cherry picked from commit 6d92a40)

# Conflicts:
#	libbeat/outputs/logstash/deadlock.go
#	libbeat/outputs/logstash/deadlock_test.go
mergify bot pushed a commit that referenced this pull request Mar 24, 2025
Fix a flaky logstash output test for the `deadlockListener`. The old test used live time tickers and occasionally failed because timing on CI machines is highly variable. This PR refactors `deadlockListener` to allow tests to override the current time and the ticker channel, so the test can run deterministically in a single goroutine with no calls to `time.Sleep`.

(cherry picked from commit 6d92a40)
mergify bot pushed a commit that referenced this pull request Mar 24, 2025
Fix a flaky logstash output test for the `deadlockListener`. The old test used live time tickers and occasionally failed because timing on CI machines is highly variable. This PR refactors `deadlockListener` to allow tests to override the current time and the ticker channel, so the test can run deterministically in a single goroutine with no calls to `time.Sleep`.

(cherry picked from commit 6d92a40)

# Conflicts:
#	libbeat/outputs/logstash/deadlock.go
#	metricbeat/module/beat/beat_external_test.go
@faec faec deleted the fix-flaky-logstash-test branch March 24, 2025 19:40
faec added a commit that referenced this pull request Mar 24, 2025
Fix a flaky logstash output test for the `deadlockListener`. The old test used live time tickers and occasionally failed because timing on CI machines is highly variable. This PR refactors `deadlockListener` to allow tests to override the current time and the ticker channel, so the test can run deterministically in a single goroutine with no calls to `time.Sleep`.

(cherry picked from commit 6d92a40)

Co-authored-by: Fae Charlton <[email protected]>
pierrehilbert pushed a commit that referenced this pull request Mar 25, 2025
Fix a flaky logstash output test for the `deadlockListener`. The old test used live time tickers and occasionally failed because timing on CI machines is highly variable. This PR refactors `deadlockListener` to allow tests to override the current time and the ticker channel, so the test can run deterministically in a single goroutine with no calls to `time.Sleep`.

(cherry picked from commit 6d92a40)

Co-authored-by: Fae Charlton <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-active-all Automated backport with mergify to all the active branches 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 this pull request may close these issues.

4 participants