You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If my Pulumi application uses getAmi to find an AMI, I get a confusing warning when running tests against the application with PULUMI_TEST_MODE. If I remove the getAmi call and hardcode an AMI ID, the test execution completes without any warning. I haven't tested if other lookup function calls cause the same warning.
$ npm run test
> aws-ts-ruby-on-rails@0.1.0 test /Users/clstokes/cc/clstokes/pulumi-aws-ts-ruby-on-rails-unit-testing
> PULUMI_TEST_MODE=true PULUMI_NODEJS_PROJECT=aws-ts-ruby-on-rails PULUMI_NODEJS_STACK=fake-stack PULUMI_CONFIG='{ "aws:region": "us-west-2", "aws-ts-ruby-on-rails:dbUser": "admin2", "aws-ts-ruby-on-rails:dbPassword": "pass2", "aws-ts-ruby-on-rails:dbRootPassword": "pass2" }' mocha -r ts-node/register *.spec.ts
(node:31550) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'invoke' of undefined
at /Users/clstokes/cc/clstokes/pulumi-aws-ts-ruby-on-rails-unit-testing/node_modules/@pulumi/pulumi/runtime/invoke.js:63:114
at new Promise (<anonymous>)
at Object.<anonymous> (/Users/clstokes/cc/clstokes/pulumi-aws-ts-ruby-on-rails-unit-testing/node_modules/@pulumi/pulumi/runtime/invoke.js:63:63)
at Generator.next (<anonymous>)
at fulfilled (/Users/clstokes/cc/clstokes/pulumi-aws-ts-ruby-on-rails-unit-testing/node_modules/@pulumi/pulumi/runtime/invoke.js:17:58)
at processTicksAndRejections (internal/process/task_queues.js:89:5)
(node:31550) 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: 2)
(node:31550) [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.
Infrastructure
#server
✓ must have a name tag
1 passing (234ms)
The Pulumi runtime detected that 120 promises were still active
at the time that the process exited. There are a few ways that this can occur:
* Not using `await` or `.then` on a Promise returned from a Pulumi API
* Introducing a cyclic dependency between two Pulumi Resources
* A bug in the Pulumi Runtime
Leaving promises active is probably not what you want. If you are unsure about
why you are seeing this message, re-run your program with the `PULUMI_DEBUG_PROMISE_LEAKS`
environment variable. The Pulumi runtime will then print out additional
debug information about the leaked promises.
The text was updated successfully, but these errors were encountered:
I would expect that all of these functions would fail because their implementations require a call into the engine in order to invoke data sources on the underlying providers, I don’t think there is a good way we can make things like getAmi work in general in test mode.
I think the best we could do here is make invokes fail with an exception in “test mode”
If my Pulumi application uses
getAmi
to find an AMI, I get a confusing warning when running tests against the application with PULUMI_TEST_MODE. If I remove thegetAmi
call and hardcode an AMI ID, the test execution completes without any warning. I haven't tested if other lookup function calls cause the same warning.Code to reproduce is at https://github.com/clstokes/pulumi-aws-ts-ruby-on-rails-unit-testing/tree/clstokes/get-ami-warning (note the
clstokes/get-ami-warning
branch).Output with warning:
The text was updated successfully, but these errors were encountered: