forked from grafana/loki
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<Promtail>: Fix flaky docker test (grafana#11777)
**What this PR does / why we need it**: We ported this fix a few days ago to the Agent via this [PR](grafana/agent#6201) but the added test is often failing in our drone pipeline. I believe that there are two reasons why this test is flaky: - the test expects that the 5 last lines of logs are the expected ones but it seems that other lines might be logged as well (https://drone.grafana.net/grafana/agent/16045/4/2) - we saw that the simulated container did not always have enough time to stop before calling the tgt.startIfNotRunning() to restart it. (https://drone.grafana.net/grafana/agent/16077/4/2) Fix: - the test now uses "assert.EventuallyWithT" and checks that within 5 seconds the expected log lines will be amongst the logs without duplicate. - the test now stops the simulated container before restarting it **Checklist** - [x] Reviewed the [`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md) guide (**required**) --------- Co-authored-by: Michel Hollands <[email protected]>
- Loading branch information
Showing
1 changed file
with
36 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters