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

Failing Jest Tests: Cannot read properties of null (reading 'createEvent') #139062

Closed
spalger opened this issue Aug 17, 2022 · 7 comments
Closed
Assignees
Labels
failed-test A test failure on a tracked branch, potentially flaky-test Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)

Comments

@spalger
Copy link
Contributor

spalger commented Aug 17, 2022

We've seen a number of failures in CI which seem to be caused by the x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/jira/jira_params.test.tsx suite.

PASS  x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/jira/jira_params.test.tsx (7.015 s)
/var/lib/buildkite-agent/builds/kb-n2-4-spot-2c4ae8a62d3d0d45/elastic/kibana-on-merge/kibana/node_modules/react-dom/cjs/react-dom.development.js:154
      var evt = document.createEvent('Event'); // Keeps track of whether the user-provided callback threw an error. We
                         ^

TypeError: Cannot read properties of null (reading 'createEvent')
    at Object.invokeGuardedCallbackDev (/var/lib/buildkite-agent/builds/kb-n2-4-spot-2c4ae8a62d3d0d45/elastic/kibana-on-merge/kibana/node_modules/react-dom/cjs/react-dom.development.js:154:26)
    at invokeGuardedCallback (/var/lib/buildkite-agent/builds/kb-n2-4-spot-2c4ae8a62d3d0d45/elastic/kibana-on-merge/kibana/node_modules/react-dom/cjs/react-dom.development.js:292:31)
    at flushPassiveEffectsImpl (/var/lib/buildkite-agent/builds/kb-n2-4-spot-2c4ae8a62d3d0d45/elastic/kibana-on-merge/kibana/node_modules/react-dom/cjs/react-dom.development.js:22853:9)
    at unstable_runWithPriority (/var/lib/buildkite-agent/builds/kb-n2-4-spot-2c4ae8a62d3d0d45/elastic/kibana-on-merge/kibana/node_modules/scheduler/cjs/scheduler.development.js:653:12)
    at runWithPriority$1 (/var/lib/buildkite-agent/builds/kb-n2-4-spot-2c4ae8a62d3d0d45/elastic/kibana-on-merge/kibana/node_modules/react-dom/cjs/react-dom.development.js:11039:10)
    at flushPassiveEffects (/var/lib/buildkite-agent/builds/kb-n2-4-spot-2c4ae8a62d3d0d45/elastic/kibana-on-merge/kibana/node_modules/react-dom/cjs/react-dom.development.js:22820:12)
    at Object.<anonymous>.flushWork (/var/lib/buildkite-agent/builds/kb-n2-4-spot-2c4ae8a62d3d0d45/elastic/kibana-on-merge/kibana/node_modules/react-dom/cjs/react-dom-test-utils.development.js:876:10)
    at Immediate.<anonymous> (/var/lib/buildkite-agent/builds/kb-n2-4-spot-2c4ae8a62d3d0d45/elastic/kibana-on-merge/kibana/node_modules/react-dom/cjs/react-dom-test-utils.development.js:887:11)
    at processImmediate (node:internal/timers:466:21)
FAIL  x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list.test.tsx

Logs: https://storage.googleapis.com/ci-artifacts.kibana.dev/logs/0182ac03-39b9-47cd-8ff0-1ca609706fb3.html

it's unclear what event is triggering this, but it seems logical to me that an event is being triggered after jsdom is torn down after x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/jira/jira_params.test.tsx is "complete". Unfortunately, since this failure happens outside of a test we don't have good reporting on how long this has been happening or where exactly this occurs. What I do know is that it's failed on main twice today so it must be pretty commonly failing in PRs too.

Because of the lack of clarity in what test is causing the issue I've skipped the tests in the following files:

  • x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/jira/jira_params.test.tsx
  • x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_event_log_list.test.tsx

Skipped:

@spalger spalger added blocker failed-test A test failure on a tracked branch, potentially flaky-test skipped-test Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.5.0 labels Aug 17, 2022
@elasticmachine
Copy link
Contributor

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

@spalger
Copy link
Contributor Author

spalger commented Sep 22, 2022

FYI, I feel like this is impacting many people now so I'm opening this up a bit. If my PR is accepted we might be able to unskip these tests without further changed. We'll still want to make sure they're not flaky before re-enabling them, but maybe our Cannot read properties of null (reading 'createEvent') nightmares can be quieted for a while.

@jonathan-buttner
Copy link
Contributor

@spalger can you link to your PR?

@spalger
Copy link
Contributor Author

spalger commented Sep 22, 2022

Oops, meta issue for my investigations: #141477
pr: #141481

@cnasikas
Copy link
Member

cnasikas commented Sep 23, 2022

@jonathan-buttner @spalger I tried to improve the test (x-pack/plugins/triggers_actions_ui/public/application/components/builtin_action_types/jira/jira_params.test.tsx) in this PR #141574. I hope it will eliminate the errors. I run the test locally 1000 times without issues.

@bhavyarm
Copy link
Contributor

bhavyarm commented Aug 4, 2023

@mikecote I removed 8.5.0 label. Could you please label this with its intended release? thanks very much!

@ersin-erdal
Copy link
Contributor

Closing this in favor of #163668

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
failed-test A test failure on a tracked branch, potentially flaky-test Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

7 participants