Skip to content

DO NOT MERGE: Unexpected error help - #4716

Closed
erikerikson wants to merge 9 commits into
serverless:masterfrom
erikerikson:unexpected-error
Closed

erikerikson wants to merge 9 commits into
serverless:masterfrom
erikerikson:unexpected-error

Conversation

@erikerikson

Copy link
Copy Markdown
Contributor

DO NOT MERGE

What did you implement:

This demonstrates an unexpected error for the purpose of obtaining help.

I've added ~/lib/classes/my.test.js that contains a single, simple test of a promise rejection.

That test fails unexpectedly with odd results. The test itself succeeds. The afterEach call following that fails giving the reason of the expected rejection from the succeeding test as the basis of the failure.

related to: #4687

... $ npm run test-bare

> [email protected] test-bare ...
> node bin/test

  Variables
    #populateObject()
      significant variable usage corner cases
        file reading cases
          √ should reject population of an attribute not exported from a
file
          1) "after each" hook

  1 passing (127ms)
  1 failing

  1) Variables #populateObject() significant variable usage corner cases
file reading cases "after each" hook:
     Uncaught ServerlessError: Invalid variable syntax when referencing
file "simple.js". Check if your javascript is returning the correct
data.
      at getDeepValue.then (lib\classes\Variables.js:494:39)
      at tryCatcher (node_modules\bluebird\js\release\util.js:16:23)
      at Promise._settlePromiseFromHandler
(node_modules\bluebird\js\release\promise.js:512:31)
      at Promise._settlePromise
(node_modules\bluebird\js\release\promise.js:569:18)
      at Promise._settlePromise0
(node_modules\bluebird\js\release\promise.js:614:10)
      at Promise._settlePromises
(node_modules\bluebird\js\release\promise.js:693:18)
      at Async._drainQueue
(node_modules\bluebird\js\release\async.js:133:16)
      at Async._drainQueues
(node_modules\bluebird\js\release\async.js:143:10)
      at Immediate.Async.drainQueues
(node_modules\bluebird\js\release\async.js:17:14)

  1 passing (129ms)
  1 failing

  1) Variables #populateObject() significant variable usage corner cases
file reading cases "after each" hook:
     Uncaught ServerlessError: Invalid variable syntax when referencing
file "simple.js". Check if your javascript is returning the correct
data.
      at getDeepValue.then (lib\classes\Variables.js:494:39)
      at tryCatcher (node_modules\bluebird\js\release\util.js:16:23)
      at Promise._settlePromiseFromHandler
(node_modules\bluebird\js\release\promise.js:512:31)
      at Promise._settlePromise
(node_modules\bluebird\js\release\promise.js:569:18)
      at Promise._settlePromise0
(node_modules\bluebird\js\release\promise.js:614:10)
      at Promise._settlePromises
(node_modules\bluebird\js\release\promise.js:693:18)
      at Async._drainQueue
(node_modules\bluebird\js\release\async.js:133:16)
      at Async._drainQueues
(node_modules\bluebird\js\release\async.js:143:10)
      at Immediate.Async.drainQueues
(node_modules\bluebird\js\release\async.js:17:14)

npm ERR! Windows_NT 10.0.16299
npm ERR! argv "...\node.exe" "...\node_modules\npm\bin\npm-cli.js" "run"
"test-bare"
npm ERR! node v6.11.4
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] test-bare: `node bin/test`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] test-bare script 'node
bin/test'.
npm ERR! Make sure you have the latest version of node.js and npm
installed.
npm ERR! If you do, this is most likely a problem with the serverless
package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node bin/test
npm ERR! You can get information on how to open an issue for this
project with:
npm ERR!     npm bugs serverless
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls serverless
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     ...\npm-debug.log

1. Add a "PromiseTracker" to the Variables class. It provides tracking
and reporting of pending variable resolutions during service
populations.
2. Decompose populateObject and populateProperty into smaller pieces
that are easier to understand.
3. Additionally, remove the immediate recursive resolution of variables,
recursing only at the Object or Property entry point (when changes have
been made). This avoids a problem where the resolved value, prior to
being replaced in the containing object or value refers to itself and
thereby is waiting on its own resolution before it will resolve itself.
4. Return the given value in warnIfNotFound so that it can chain.
```
... $ npm run test-bare

> [email protected] test-bare ...
> node bin/test

  Variables
    #populateObject()
      significant variable usage corner cases
        file reading cases
          √ should reject population of an attribute not exported from a
file
          1) "after each" hook

  1 passing (127ms)
  1 failing

  1) Variables #populateObject() significant variable usage corner cases
file reading cases "after each" hook:
     Uncaught ServerlessError: Invalid variable syntax when referencing
file "simple.js". Check if your javascript is returning the correct
data.
      at getDeepValue.then (lib\classes\Variables.js:494:39)
      at tryCatcher (node_modules\bluebird\js\release\util.js:16:23)
      at Promise._settlePromiseFromHandler
(node_modules\bluebird\js\release\promise.js:512:31)
      at Promise._settlePromise
(node_modules\bluebird\js\release\promise.js:569:18)
      at Promise._settlePromise0
(node_modules\bluebird\js\release\promise.js:614:10)
      at Promise._settlePromises
(node_modules\bluebird\js\release\promise.js:693:18)
      at Async._drainQueue
(node_modules\bluebird\js\release\async.js:133:16)
      at Async._drainQueues
(node_modules\bluebird\js\release\async.js:143:10)
      at Immediate.Async.drainQueues
(node_modules\bluebird\js\release\async.js:17:14)

  1 passing (129ms)
  1 failing

  1) Variables #populateObject() significant variable usage corner cases
file reading cases "after each" hook:
     Uncaught ServerlessError: Invalid variable syntax when referencing
file "simple.js". Check if your javascript is returning the correct
data.
      at getDeepValue.then (lib\classes\Variables.js:494:39)
      at tryCatcher (node_modules\bluebird\js\release\util.js:16:23)
      at Promise._settlePromiseFromHandler
(node_modules\bluebird\js\release\promise.js:512:31)
      at Promise._settlePromise
(node_modules\bluebird\js\release\promise.js:569:18)
      at Promise._settlePromise0
(node_modules\bluebird\js\release\promise.js:614:10)
      at Promise._settlePromises
(node_modules\bluebird\js\release\promise.js:693:18)
      at Async._drainQueue
(node_modules\bluebird\js\release\async.js:133:16)
      at Async._drainQueues
(node_modules\bluebird\js\release\async.js:143:10)
      at Immediate.Async.drainQueues
(node_modules\bluebird\js\release\async.js:17:14)

npm ERR! Windows_NT 10.0.16299
npm ERR! argv "...\node.exe" "...\node_modules\npm\bin\npm-cli.js" "run"
"test-bare"
npm ERR! node v6.11.4
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] test-bare: `node bin/test`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] test-bare script 'node
bin/test'.
npm ERR! Make sure you have the latest version of node.js and npm
installed.
npm ERR! If you do, this is most likely a problem with the serverless
package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node bin/test
npm ERR! You can get information on how to open an issue for this
project with:
npm ERR!     npm bugs serverless
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls serverless
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     ...\npm-debug.log
```
@erikerikson

Copy link
Copy Markdown
Contributor Author

What dumb thing am I doing?

@erikerikson

Copy link
Copy Markdown
Contributor Author

totally my f-up. sorry.

@erikerikson erikerikson closed this Feb 4, 2018
@erikerikson erikerikson reopened this Feb 4, 2018
@erikerikson

Copy link
Copy Markdown
Contributor Author

unfortunately, my f-up was thinking this was my f-up. it is now ridiculously traced and it is acting as expected. I have removed everything that can be removed.

@erikerikson

Copy link
Copy Markdown
Contributor Author

Was chasing a bad interaction between BbPromise.reduce and chai.
See chaijs/chai#1134 for a clean repro.

@erikerikson erikerikson closed this Feb 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant