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 test: Jest Tests.x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client - createApmEventClient cancels a search when a request is aborted #90155

Closed
kibanamachine opened this issue Feb 3, 2021 · 6 comments
Assignees
Labels
failed-test A test failure on a tracked branch, potentially flaky-test Team:APM All issues that need APM UI Team support

Comments

@kibanamachine
Copy link
Contributor

kibanamachine commented Feb 3, 2021

A test failed on a tracked branch

Error: expect(jest.fn()).toHaveBeenCalled()

Expected number of calls: >= 1
Received number of calls:    0
    at Object.<anonymous> (/dev/shm/workspace/kibana/x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/index.test.ts:77:19)
    at _callCircusTest (/dev/shm/workspace/kibana/node_modules/jest-circus/build/run.js:212:5)
    at _runTest (/dev/shm/workspace/kibana/node_modules/jest-circus/build/run.js:149:3)
    at _runTestsForDescribeBlock (/dev/shm/workspace/kibana/node_modules/jest-circus/build/run.js:63:9)
    at _runTestsForDescribeBlock (/dev/shm/workspace/kibana/node_modules/jest-circus/build/run.js:57:9)
    at run (/dev/shm/workspace/kibana/node_modules/jest-circus/build/run.js:25:3)
    at runAndTransformResultsToJestFormat (/dev/shm/workspace/kibana/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:176:21)
    at jestAdapter (/dev/shm/workspace/kibana/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:109:19)
    at runTestInternal (/dev/shm/workspace/kibana/node_modules/jest-runner/build/runTest.js:380:16)
    at runTest (/dev/shm/workspace/kibana/node_modules/jest-runner/build/runTest.js:472:34)
    at Object.worker (/dev/shm/workspace/kibana/node_modules/jest-runner/build/testWorker.js:133:12)

First failure: Jenkins Build

@kibanamachine kibanamachine added the failed-test A test failure on a tracked branch, potentially flaky-test label Feb 3, 2021
@mistic mistic added the Team:APM All issues that need APM UI Team support label Feb 3, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/apm-ui (Team:apm)

@kibanamachine
Copy link
Contributor Author

New failure: Jenkins Build

@dgieselaar
Copy link
Member

I think this was fixed in #90728, closing.

@kibanamachine
Copy link
Contributor Author

New failure: Jenkins Build

@kibanamachine kibanamachine reopened this Jul 7, 2021
@spalger
Copy link
Contributor

spalger commented Jul 7, 2021

Interesting... not super worried about this but it's very strange that this hasn't failed in so long and then failed twice, once in 7.13 (above) and once in this PR (#104747) at the same time... Spooky?

18:49:26   FAIL  x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/index.test.ts (6.308 s)
18:49:26    ● createApmEventClient › cancels a search when a request is aborted
18:49:26  
18:49:26      expect(jest.fn()).toHaveBeenCalled()
18:49:26  
18:49:26      Expected number of calls: >= 1
18:49:26      Received number of calls:    0
18:49:26  
18:49:26        76 |     });
18:49:26        77 |
18:49:26      > 78 |     expect(abort).toHaveBeenCalled();
18:49:26           |                   ^
18:49:26        79 |   });
18:49:26        80 | });
18:49:26        81 |
18:49:26  
18:49:26        at Object.<anonymous> (x-pack/plugins/apm/server/lib/helpers/create_es_client/create_apm_event_client/index.test.ts:78:19)
18:49:26  

@sorenlouv
Copy link
Member

sorenlouv commented Jul 8, 2021

@dgieselaar Probably won't make a difference but perhaps the abort listener should be added immediately (instead of inside the setTimeout)

await new Promise((resolve) => {
  incomingRequest.on("abort", () => {
    setTimeout(resolve, 100);
  });

  setTimeout(() => incomingRequest.abort(), 100);
});

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:APM All issues that need APM UI Team support
Projects
None yet
Development

No branches or pull requests

7 participants