-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make telemetry task use a schedule instead of scheduling explicitly f…
…or midnight (#153380) Fixes #140973 Fixes elastic/kibana-team#563 In this PR, I'm fixing flaky tests that caused extra telemetry runs whenever CI would run them near midnight UTC. The assertion expected two runs while sometimes a 3rd run would happen if the test ran near midnight when the telemetry task was scheduled to run again.. To fix this, I've moved away from the midnight scheduling given telemetry only needs to be reported daily, and moved the task to use a `schedule` within task manager to make the task run daily (+24hrs from the previous run). This also improves error handling given task manager will now know it's a recurring task and recurring tasks never get marked as `failed`. The following verification steps can be done using this query in Dev Tools ``` GET .kibana_task_manager/_search { "query": { "term": { "task.taskType": "actions_telemetry" } } } ``` ## To verify existing tasks migrating to a schedule 1. Using `main`, setup a fresh Kibana and ES instance 2. Keep Elasticsearch running but shut down Kibana after setup is complete 3. Switch from `main` to this PR 4. Add `await taskManager.runSoon(TASK_ID);` after the `ensureScheduled` call within `x-pack/plugins/actions/server/usage/task.ts`. 5. Startup Kibana 6. Go in Dev Tools and pull the task information to see a new `schedule` attribute added ## To verify fresh installs 1. Using this PR code, setup a fresh Kibana and ES instance 2. Go in Dev Tools and pull the task information to see a new `schedule` attribute added Flaky test runner: https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/2017 --------- Co-authored-by: Kibana Machine <[email protected]>
- Loading branch information
1 parent
bbe3d52
commit 6a16932
Showing
4 changed files
with
17 additions
and
15 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
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
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
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