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

[EventLog] Use performance.now() rather than Date.now() to calculate elapsed time in tests #158721

Merged
merged 3 commits into from
Jun 1, 2023

Conversation

ersin-erdal
Copy link
Contributor

@ersin-erdal ersin-erdal commented May 31, 2023

Resolves: #156061

Since all the failed CI results show actual elapsed time as 19 rather than 20 (expected), the issue seems like an inaccurate time calculation caused by Date.now() method.

Replacing Date.now() with the more precise performance.now() method may solve the problem.

@ersin-erdal ersin-erdal added release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.9.0 labels May 31, 2023
@ersin-erdal ersin-erdal self-assigned this May 31, 2023
@ersin-erdal ersin-erdal changed the title Set retry timeouts randomise false for es initialisation [Event Log] Make retryDelay in mock 1ms less to cover JS time difference calculation discrepancy May 31, 2023
@ersin-erdal ersin-erdal changed the title [Event Log] Make retryDelay in mock 1ms less to cover JS time difference calculation discrepancy [Event Log] Use performance.now() rather than Date.now() to calculate elapsed time in tests May 31, 2023
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #37 / aiops change point detection shows multiple results when split field is selected

Metrics [docs]

Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
securitySolution 416 420 +4
total +6

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
securitySolution 500 504 +4
total +6

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @ersin-erdal

@ersin-erdal ersin-erdal changed the title [Event Log] Use performance.now() rather than Date.now() to calculate elapsed time in tests [EventLog] Use performance.now() rather than Date.now() to calculate elapsed time in tests May 31, 2023
@ersin-erdal ersin-erdal marked this pull request as ready for review May 31, 2023 18:38
@ersin-erdal ersin-erdal requested a review from a team as a code owner May 31, 2023 18:38
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

Copy link
Contributor

@ymao1 ymao1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ersin-erdal ersin-erdal merged commit 72fa065 into elastic:main Jun 1, 2023
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Jun 1, 2023
@ersin-erdal ersin-erdal deleted the 156061-event-log-retry-flaky branch June 1, 2023 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failing test: Jest Tests.x-pack/plugins/event_log/server/es - retries createIlmPolicyIfNotExists with 1 retry
5 participants