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

replaceInjectedVars uiExport mocha test logging UnhandledPromiseRejectionWarning #40756

Closed
nreese opened this issue Jul 10, 2019 · 2 comments · Fixed by #39446
Closed

replaceInjectedVars uiExport mocha test logging UnhandledPromiseRejectionWarning #40756

nreese opened this issue Jul 10, 2019 · 2 comments · Fixed by #39446
Assignees
Labels
Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! test

Comments

@nreese
Copy link
Contributor

nreese commented Jul 10, 2019

From x-pack folder run node scripts/mocha.js legacy/plugins/xpack_main/server/lib/__tests__/replace_injected_vars.js.

Below is the output from the test. Notice UnhandledPromiseRejectionWarning warnings. I would expect the test to run without logging any warnings.

replaceInjectedVars uiExport
    ✓ sends xpack info if request is authenticated and license is not basic
    ✓ sends the xpack info if security plugin is disabled
    ✓ sends the xpack info if xpack license is basic
    ✓ respects the telemetry opt-in document when opted-out
    ✓ respects the telemetry opt-in document when opted-in
    ✓ indicates that telemetry is opted-out when not loading an application
    ✓ sends the originalInjectedVars if not authenticated
(node:18755) UnhandledPromiseRejectionWarning: Error: not found exception
    at buildRequest (/Users/nathanreese/projects/kibana/x-pack/legacy/plugins/xpack_main/server/lib/__tests__/replace_injected_vars.js:15:67)
    at Context.buildRequest (/Users/nathanreese/projects/kibana/x-pack/legacy/plugins/xpack_main/server/lib/__tests__/replace_injected_vars.js:138:21)
    at callFn (/Users/nathanreese/projects/kibana/node_modules/mocha/lib/runnable.js:348:21)
    at Test.Runnable.run (/Users/nathanreese/projects/kibana/node_modules/mocha/lib/runnable.js:340:7)
    at Runner.runTest (/Users/nathanreese/projects/kibana/node_modules/mocha/lib/runner.js:443:10)
    at /Users/nathanreese/projects/kibana/node_modules/mocha/lib/runner.js:549:12
    at next (/Users/nathanreese/projects/kibana/node_modules/mocha/lib/runner.js:361:14)
    at /Users/nathanreese/projects/kibana/node_modules/mocha/lib/runner.js:371:7
    at next (/Users/nathanreese/projects/kibana/node_modules/mocha/lib/runner.js:295:14)
    at Immediate.<anonymous> (/Users/nathanreese/projects/kibana/node_modules/mocha/lib/runner.js:339:5)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)
(node:18755) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)
(node:18755) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
    ✓ sends the originalInjectedVars if xpack info is unavailable
(node:18755) UnhandledPromiseRejectionWarning: Error: not found exception
    at buildRequest (/Users/nathanreese/projects/kibana/x-pack/legacy/plugins/xpack_main/server/lib/__tests__/replace_injected_vars.js:15:67)
    at Context.buildRequest (/Users/nathanreese/projects/kibana/x-pack/legacy/plugins/xpack_main/server/lib/__tests__/replace_injected_vars.js:148:21)
    at callFn (/Users/nathanreese/projects/kibana/node_modules/mocha/lib/runnable.js:348:21)
    at Test.Runnable.run (/Users/nathanreese/projects/kibana/node_modules/mocha/lib/runnable.js:340:7)
    at Runner.runTest (/Users/nathanreese/projects/kibana/node_modules/mocha/lib/runner.js:443:10)
    at /Users/nathanreese/projects/kibana/node_modules/mocha/lib/runner.js:549:12
    at next (/Users/nathanreese/projects/kibana/node_modules/mocha/lib/runner.js:361:14)
    at /Users/nathanreese/projects/kibana/node_modules/mocha/lib/runner.js:371:7
    at next (/Users/nathanreese/projects/kibana/node_modules/mocha/lib/runner.js:295:14)
    at Immediate.<anonymous> (/Users/nathanreese/projects/kibana/node_modules/mocha/lib/runner.js:339:5)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)
(node:18755) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 5)
    ✓ sends the originalInjectedVars (with xpackInitialInfo = undefined) if security is disabled, xpack info is unavailable
    ✓ sends the originalInjectedVars if the license check result is not available
(node:18755) UnhandledPromiseRejectionWarning: Error: not found exception
    at buildRequest (/Users/nathanreese/projects/kibana/x-pack/legacy/plugins/xpack_main/server/lib/__tests__/replace_injected_vars.js:15:67)
    at Context.buildRequest (/Users/nathanreese/projects/kibana/x-pack/legacy/plugins/xpack_main/server/lib/__tests__/replace_injected_vars.js:180:21)
    at callFn (/Users/nathanreese/projects/kibana/node_modules/mocha/lib/runnable.js:348:21)
    at Test.Runnable.run (/Users/nathanreese/projects/kibana/node_modules/mocha/lib/runnable.js:340:7)
    at Runner.runTest (/Users/nathanreese/projects/kibana/node_modules/mocha/lib/runner.js:443:10)
    at /Users/nathanreese/projects/kibana/node_modules/mocha/lib/runner.js:549:12
    at next (/Users/nathanreese/projects/kibana/node_modules/mocha/lib/runner.js:361:14)
    at /Users/nathanreese/projects/kibana/node_modules/mocha/lib/runner.js:371:7
    at next (/Users/nathanreese/projects/kibana/node_modules/mocha/lib/runner.js:295:14)
    at Immediate.<anonymous> (/Users/nathanreese/projects/kibana/node_modules/mocha/lib/runner.js:339:5)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)
(node:18755) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 7)


  10 passing (45ms)

@nreese nreese added test Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! labels Jul 10, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-security

@azasypkin
Copy link
Member

Thanks for filing. I believe this will be implicitly fixed by my changes in #39446. I don't these warnings there anymore, so 🤞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! test
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants