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

WIP: Safer tests #1946

Closed
wants to merge 9 commits into from
Closed

WIP: Safer tests #1946

wants to merge 9 commits into from

Conversation

rmg
Copy link
Member

@rmg rmg commented Jan 7, 2016

I started cleaning up the tests in order to debug the windows failures, but haven't had time to finish yet.

@superkhau and @jannyHou have each contacted me separately about the failures, so I'm opening this PR to get more eyes.

@rmg rmg added the #review label Jan 7, 2016
@jannyHou jannyHou self-assigned this Jan 19, 2016
@Amir-61 Amir-61 mentioned this pull request Jan 20, 2016
@jannyHou jannyHou added #tob and removed #review labels Jan 21, 2016
@jannyHou
Copy link
Contributor

hey @rmg @bajtos I test on one linux vm and manage to reproduce 4 errors.
Configue:

  • OS: ub14x86
  • node: 4.1.0
  • npm: 2.14.3

I fixed them by removing strong-remoting under dependant loopback-connector-remote's folder.

When I clone loopback from github and npm install it, loopback-connector-remote installs strong-remoting 2.24.5 automatically under its node_modules folder which causes the failure.
I guess it calls that one instead of the strong-remoting in root node_modules folder.
There is also a loopback-datasource-juggler 2.24.22 there but it doesn't affect the results.

I am not sure are they necessarily installed as nested modules of loopback-connector-remote, but from the version number they look old and npm test could pass after I remove them :)
https://github.com/strongloop/loopback-connector-remote/blob/master/package.json#L29-L30

Error details:

1) RemoteConnector should support the save method:

      Uncaught AssertionError: false == true
      + expected - actual

      -false
      +true

      at HttpInvocation.<anonymous> (test/remote-connector.test.js:68:7)
      at node_modules/loopback-connector-remote/node_modules/strong-remoting/lib/rest-adapter.js:131:18
      at execStack (node_modules/loopback-connector-remote/node_modules/strong-remoting/lib/remote-objects.js:460:7)
      at RemoteObjects.execHooks (node_modules/loopback-connector-remote/node_modules/strong-remoting/lib/remote-objects.js:464:10)
      at HttpInvocation.<anonymous> (node_modules/loopback-connector-remote/node_modules/strong-remoting/lib/rest-adapter.js:129:15)
      at HttpInvocation.transformResponse (node_modules/loopback-connector-remote/node_modules/strong-remoting/lib/http-invocation.js:337:12)
      at Request._callback (node_modules/loopback-connector-remote/node_modules/strong-remoting/lib/http-invocation.js:261:10)
      at Request.self.callback (node_modules/loopback-connector-remote/node_modules/strong-remoting/node_modules/request/request.js:198:22)
      at Request.<anonymous> (node_modules/loopback-connector-remote/node_modules/strong-remoting/node_modules/request/request.js:1035:10)
      at IncomingMessage.<anonymous> (node_modules/loopback-connector-remote/node_modules/strong-remoting/node_modules/request/request.js:962:12)

  2) RemoteConnector Model Tests Model.create([data], [callback]) Create an instance of Model with given data and save to the attached data source:

      Uncaught AssertionError: false == true
      + expected - actual

      -false
      +true

      at HttpInvocation.<anonymous> (test/util/model-tests.js:136:11)
      at node_modules/loopback-connector-remote/node_modules/strong-remoting/lib/rest-adapter.js:131:18
      at execStack (node_modules/loopback-connector-remote/node_modules/strong-remoting/lib/remote-objects.js:460:7)
      at RemoteObjects.execHooks (node_modules/loopback-connector-remote/node_modules/strong-remoting/lib/remote-objects.js:464:10)
      at HttpInvocation.<anonymous> (node_modules/loopback-connector-remote/node_modules/strong-remoting/lib/rest-adapter.js:129:15)
      at HttpInvocation.transformResponse (node_modules/loopback-connector-remote/node_modules/strong-remoting/lib/http-invocation.js:337:12)
      at Request._callback (node_modules/loopback-connector-remote/node_modules/strong-remoting/lib/http-invocation.js:261:10)
      at Request.self.callback (node_modules/loopback-connector-remote/node_modules/strong-remoting/node_modules/request/request.js:198:22)
      at Request.<anonymous> (node_modules/loopback-connector-remote/node_modules/strong-remoting/node_modules/request/request.js:1035:10)
      at IncomingMessage.<anonymous> (node_modules/loopback-connector-remote/node_modules/strong-remoting/node_modules/request/request.js:962:12)

  3) RemoteConnector Model Tests model.updateAttributes(data, [callback]) Save specified attributes to the attached data source:
     Uncaught TypeError: user.updateAttributes is not a function
      at HttpInvocation.<anonymous> (test/util/model-tests.js:160:16)
      at node_modules/loopback-connector-remote/node_modules/strong-remoting/lib/rest-adapter.js:131:18
      at execStack (node_modules/loopback-connector-remote/node_modules/strong-remoting/lib/remote-objects.js:460:7)
      at RemoteObjects.execHooks (node_modules/loopback-connector-remote/node_modules/strong-remoting/lib/remote-objects.js:464:10)
      at HttpInvocation.<anonymous> (node_modules/loopback-connector-remote/node_modules/strong-remoting/lib/rest-adapter.js:129:15)
      at HttpInvocation.transformResponse (node_modules/loopback-connector-remote/node_modules/strong-remoting/lib/http-invocation.js:337:12)
      at Request._callback (node_modules/loopback-connector-remote/node_modules/strong-remoting/lib/http-invocation.js:261:10)
      at Request.self.callback (node_modules/loopback-connector-remote/node_modules/strong-remoting/node_modules/request/request.js:198:22)
      at Request.<anonymous> (node_modules/loopback-connector-remote/node_modules/strong-remoting/node_modules/request/request.js:1035:10)
      at IncomingMessage.<anonymous> (node_modules/loopback-connector-remote/node_modules/strong-remoting/node_modules/request/request.js:962:12)

  4) Replication over REST conflict resolution with model-level permissions as user with REPLICATE-only permissions allows reverse resolve() on the client:
     Uncaught TypeError: target.toObject is not a function
      at common/models/change.js:706:16
      at done (common/models/change.js:604:7)
      at node_modules/async/lib/async.js:251:17
      at done (node_modules/async/lib/async.js:132:19)
      at node_modules/async/lib/async.js:32:16
      at node_modules/async/lib/async.js:248:21
      at node_modules/async/lib/async.js:572:34
      at HttpInvocation.<anonymous> (common/models/change.js:598:9)
      at node_modules/loopback-connector-remote/node_modules/strong-remoting/lib/rest-adapter.js:131:18
      at execStack (node_modules/loopback-connector-remote/node_modules/strong-remoting/lib/remote-objects.js:460:7)
      at RemoteObjects.execHooks (node_modules/loopback-connector-remote/node_modules/strong-remoting/lib/remote-objects.js:464:10)
      at HttpInvocation.<anonymous> (node_modules/loopback-connector-remote/node_modules/strong-remoting/lib/rest-adapter.js:129:15)
      at HttpInvocation.transformResponse (node_modules/loopback-connector-remote/node_modules/strong-remoting/lib/http-invocation.js:337:12)
      at Request._callback (node_modules/loopback-connector-remote/node_modules/strong-remoting/lib/http-invocation.js:261:10)
      at Request.self.callback (node_modules/loopback-connector-remote/node_modules/strong-remoting/node_modules/request/request.js:198:22)

@jannyHou jannyHou added #wip and removed #plan labels Jan 26, 2016
@bajtos
Copy link
Member

bajtos commented Jan 26, 2016

@jannyHou thank you for the investigation and a detailed report.

loopback-connector-remote depends on strong-remoting (and loopback-datasource-juggler) because it uses some of the code/functionality provided by these modules.

We were aware that juggler is designed as a singleton (i.e. there should be only one instance of the module in the dependency tree), there is a task to fix it - strongloop/loopback-connector-remote#5

I am quite surprised that strong-remoting suffers from the same problem too. We need to investigate this more to better understand why two instances of strong-remoting don't work well.

Here is the reason why this problem is not observed on the 2.x branch: because both loopback and loopback-connector-remote depend on the latest 2.x version of strong-remoting, npm install will skip installation of loopback-connector-remote/node_modules/strong-remoting and let loopback-connector-remote use the copy of strong-remoting installed directly in loopback's node_modules.

@bajtos
Copy link
Member

bajtos commented Jan 26, 2016

I identified the problem. strong-remoting has a global registry of Dynamic converters that are used to convert responses e.g. from a plain object to a model instance. LoopBack registers all models with it's instance of strong-remoting. However, the remoting connector has its own Dynamic registry that is not populated with application models.

@jannyHou fixing this problem is non-trivial, I'll work on this myself - see strongloop/loopback-connector-remote#34

@bajtos
Copy link
Member

bajtos commented Jan 26, 2016

@slnode test please

@bajtos
Copy link
Member

bajtos commented Jan 26, 2016

strongloop/loopback-connector-remote#34 has been landed, let's check how CI likes that

@@ -1,4 +1,4 @@
# LoopBack
# LoopBack1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a type/forgotten change, please remove.

rmg and others added 4 commits January 26, 2016 11:05
If the supertest request fails its basic assertions, there may not even
be a body to perform checks against, so bail early when possible.
@jannyHou
Copy link
Contributor

@slnode test please

@jannyHou
Copy link
Contributor

@slnode test please

@jannyHou
Copy link
Contributor

  1. Errors come from test/hidden-properties.test.js, I commented .expect('Content-Type', /json/) to expose the real error:

expected 200 "OK", got 404 "Not Found"

So the pr for "content type" is fine, the error comes from endpoint itself

  1. The single test passes when I run mocha -g 'should hide a property remotely'
    I removed strong-remoting under loopback-connector-remoting but this doesn't help.

  2. I am also confused why the test failures are duplicate(6 errors in total but actually only 3 errors, other 3 are duplicate).

Detailed error information with longjohn:

1)  "before each" hook:
     TypeError: Cannot read property 'currentRetry' of undefined
      at C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\mocha\lib\                                      runner.js:536:27
      at Runner.runTest (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_mo                                      dules\mocha\lib\runner.js:424:5)
      at C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\mocha\lib\                                      runner.js:533:12
      at next (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\moch                                      a\lib\runner.js:342:14)
      at C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\mocha\lib\                                      runner.js:352:7
      at next (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\moch                                      a\lib\runner.js:284:14)
      at C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\mocha\lib\                                      runner.js:315:7
      at done (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\moch                                      a\lib\runnable.js:276:5)
      at callFn (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\mo                                      cha\lib\runnable.js:333:7)
      at Hook.Runnable.run (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node                                      _modules\mocha\lib\runnable.js:308:7)
      at next (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\moch                                      a\lib\runner.js:298:10)
      at Immediate._onImmediate (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback                                      \node_modules\mocha\lib\runner.js:320:5)
  ---------------------------------------------
      at next (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\moch                                      a\lib\runner.js:293:12)
      at Immediate._onImmediate (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback                                      \node_modules\mocha\lib\runner.js:320:5)

  2) hidden properties should hide a property remotely:
     Error: expected 200 "OK", got 404 "Not Found"
      at Test.assert (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modul                                      es\supertest\lib\test.js:205:15)
      at Server.assert (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_mod                                      ules\supertest\lib\test.js:132:12)
      at emitCloseNT (net.js:1524:8)
      at C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\continuati                                      on-local-storage\node_modules\async-listener\glue.js:188:31
  ---------------------------------------------
      at Server.close (net.js:1480:12)
      at C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\supertest\                                      lib\test.js:127:31
      at Test.Request.callback (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\                                      node_modules\supertest\node_modules\superagent\lib\node\index.js:746:30)
      at Test.<anonymous> (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_                                      modules\supertest\node_modules\superagent\lib\node\index.js:135:10)
      at IncomingMessage.<anonymous> (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loo                                      pback\node_modules\supertest\node_modules\superagent\lib\node\index.js:938:12)
      at endReadableNT (_stream_readable.js:905:12)
      at C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\continuati                                      on-local-storage\node_modules\async-listener\glue.js:188:31
  ---------------------------------------------
      at Test.Request (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modu                                      les\supertest\node_modules\superagent\lib\node\index.js:134:8)
      at new Test (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\                                      supertest\lib\test.js:29:11)
      at Object.obj.(anonymous function) [as get] (C:\Users\IBM_ADMIN\Desktop\ci                                      -loopback\loopback\node_modules\supertest\index.js:25:14)
      at Context.<anonymous> (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\te                                      st\hidden-properties.test.js:39:9)
      at callFnAsync (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modul                                      es\mocha\lib\runnable.js:338:8)
      at Test.Runnable.run (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node                                      _modules\mocha\lib\runnable.js:290:7)
      at Runner.runTest (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_mo                                      dules\mocha\lib\runner.js:422:10)
      at C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\mocha\lib\                                      runner.js:533:12
      at next (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\moch                                      a\lib\runner.js:342:14)
      at C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\mocha\lib\                                      runner.js:352:7
      at next (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\moch                                      a\lib\runner.js:284:14)
      at Immediate._onImmediate (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback                                      \node_modules\mocha\lib\runner.js:320:5)

  3) hidden properties should hide a property remotely:
     Error: expected 200 "OK", got 404 "Not Found"
      at Test.assert (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modul                                      es\supertest\lib\test.js:205:15)
      at Server.assert (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_mod                                      ules\supertest\lib\test.js:132:12)
      at emitCloseNT (net.js:1524:8)
      at C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\continuati                                      on-local-storage\node_modules\async-listener\glue.js:188:31
  ---------------------------------------------
      at Server.close (net.js:1480:12)
      at C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\supertest\                                      lib\test.js:127:31
      at Test.Request.callback (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\                                      node_modules\supertest\node_modules\superagent\lib\node\index.js:746:30)
      at Test.<anonymous> (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_                                      modules\supertest\node_modules\superagent\lib\node\index.js:135:10)
      at IncomingMessage.<anonymous> (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loo                                      pback\node_modules\supertest\node_modules\superagent\lib\node\index.js:938:12)
      at endReadableNT (_stream_readable.js:905:12)
      at C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\continuati                                      on-local-storage\node_modules\async-listener\glue.js:188:31
  ---------------------------------------------
      at Test.Request (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modu                                      les\supertest\node_modules\superagent\lib\node\index.js:134:8)
      at new Test (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\                                      supertest\lib\test.js:29:11)
      at Object.obj.(anonymous function) [as get] (C:\Users\IBM_ADMIN\Desktop\ci                                      -loopback\loopback\node_modules\supertest\index.js:25:14)
      at Context.<anonymous> (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\te                                      st\hidden-properties.test.js:39:9)
      at callFnAsync (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modul                                      es\mocha\lib\runnable.js:338:8)
      at Test.Runnable.run (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node                                      _modules\mocha\lib\runnable.js:290:7)
      at Runner.runTest (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_mo                                      dules\mocha\lib\runner.js:422:10)
      at C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\mocha\lib\                                      runner.js:533:12
      at next (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\moch                                      a\lib\runner.js:342:14)
      at C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\mocha\lib\                                      runner.js:352:7
      at next (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\moch                                      a\lib\runner.js:284:14)
      at Immediate._onImmediate (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback                                      \node_modules\mocha\lib\runner.js:320:5)

  4) hidden properties should hide a property of nested models:
     Error: expected 200 "OK", got 404 "Not Found"
      at Test.assert (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modul                                      es\supertest\lib\test.js:205:15)
      at Server.assert (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_mod                                      ules\supertest\lib\test.js:132:12)
      at emitCloseNT (net.js:1524:8)
      at C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\continuati                                      on-local-storage\node_modules\async-listener\glue.js:188:31
  ---------------------------------------------
      at Server.close (net.js:1480:12)
      at C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\supertest\                                      lib\test.js:127:31
      at Test.Request.callback (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\                                      node_modules\supertest\node_modules\superagent\lib\node\index.js:746:30)
      at Test.<anonymous> (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_                                      modules\supertest\node_modules\superagent\lib\node\index.js:135:10)
      at IncomingMessage.<anonymous> (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loo                                      pback\node_modules\supertest\node_modules\superagent\lib\node\index.js:938:12)
      at endReadableNT (_stream_readable.js:905:12)
      at C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\continuati                                      on-local-storage\node_modules\async-listener\glue.js:188:31
  ---------------------------------------------
      at Test.Request (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modu                                      les\supertest\node_modules\superagent\lib\node\index.js:134:8)
      at new Test (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\                                      supertest\lib\test.js:29:11)
      at Object.obj.(anonymous function) [as get] (C:\Users\IBM_ADMIN\Desktop\ci                                      -loopback\loopback\node_modules\supertest\index.js:25:14)
      at Context.<anonymous> (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\te                                      st\hidden-properties.test.js:53:8)
      at callFnAsync (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modul                                      es\mocha\lib\runnable.js:338:8)
      at Test.Runnable.run (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node                                      _modules\mocha\lib\runnable.js:290:7)
      at Runner.runTest (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_mo                                      dules\mocha\lib\runner.js:422:10)
      at C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\mocha\lib\                                      runner.js:533:12
      at next (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\moch                                      a\lib\runner.js:342:14)
      at C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\mocha\lib\                                      runner.js:352:7
      at next (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\moch                                      a\lib\runner.js:284:14)
      at Immediate._onImmediate (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback                                      \node_modules\mocha\lib\runner.js:320:5)

  5) hidden properties should hide a property of nested models:
     Error: expected 200 "OK", got 404 "Not Found"
      at Test.assert (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modul                                      es\supertest\lib\test.js:205:15)
      at Server.assert (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_mod                                      ules\supertest\lib\test.js:132:12)
      at emitCloseNT (net.js:1524:8)
      at C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\continuati                                      on-local-storage\node_modules\async-listener\glue.js:188:31
  ---------------------------------------------
      at Server.close (net.js:1480:12)
      at C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\supertest\                                      lib\test.js:127:31
      at Test.Request.callback (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\                                      node_modules\supertest\node_modules\superagent\lib\node\index.js:746:30)
      at Test.<anonymous> (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_                                      modules\supertest\node_modules\superagent\lib\node\index.js:135:10)
      at IncomingMessage.<anonymous> (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loo                                      pback\node_modules\supertest\node_modules\superagent\lib\node\index.js:938:12)
      at endReadableNT (_stream_readable.js:905:12)
      at C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\continuati                                      on-local-storage\node_modules\async-listener\glue.js:188:31
  ---------------------------------------------
      at Test.Request (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modu                                      les\supertest\node_modules\superagent\lib\node\index.js:134:8)
      at new Test (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\                                      supertest\lib\test.js:29:11)
      at Object.obj.(anonymous function) [as get] (C:\Users\IBM_ADMIN\Desktop\ci                                      -loopback\loopback\node_modules\supertest\index.js:25:14)
      at Context.<anonymous> (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\te                                      st\hidden-properties.test.js:53:8)
      at callFnAsync (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modul                                      es\mocha\lib\runnable.js:338:8)
      at Test.Runnable.run (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node                                      _modules\mocha\lib\runnable.js:290:7)
      at Runner.runTest (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_mo                                      dules\mocha\lib\runner.js:422:10)
      at C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\mocha\lib\                                      runner.js:533:12
      at next (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\moch                                      a\lib\runner.js:342:14)
      at C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\mocha\lib\                                      runner.js:352:7
      at next (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\moch                                      a\lib\runner.js:284:14)
      at Immediate._onImmediate (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback                                      \node_modules\mocha\lib\runner.js:320:5)

  6)  "before each" hook:
     TypeError: Cannot read property 'currentRetry' of undefined
      at C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\mocha\lib\                                      runner.js:536:27
      at Runner.runTest (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_mo                                      dules\mocha\lib\runner.js:424:5)
      at C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\mocha\lib\                                      runner.js:533:12
      at next (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\moch                                      a\lib\runner.js:342:14)
      at C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\mocha\lib\                                      runner.js:352:7
      at next (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\moch                                      a\lib\runner.js:284:14)
      at C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\mocha\lib\                                      runner.js:315:7
      at done (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\moch                                      a\lib\runnable.js:276:5)
      at callFn (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\mo                                      cha\lib\runnable.js:333:7)
      at Hook.Runnable.run (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node                                      _modules\mocha\lib\runnable.js:308:7)
      at next (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\moch                                      a\lib\runner.js:298:10)
      at Immediate._onImmediate (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback                                      \node_modules\mocha\lib\runner.js:320:5)
  ---------------------------------------------
      at next (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback\node_modules\moch                                      a\lib\runner.js:293:12)
      at Immediate._onImmediate (C:\Users\IBM_ADMIN\Desktop\ci-loopback\loopback                                      \node_modules\mocha\lib\runner.js:320:5)

@richardpringle
Copy link
Contributor

To me, it looks like there is an issue with supertest. I have seen this issue pop up before although I can't remember exactly how it gets resolved.

I'm guessing there is an issue booting up the server somewhere. In the past I've seen that for whatever reason, supertest does not "stop" the app instance properly, which would explain why the test is attempted multiple time, and why it passes on it's own but not with the other tests.

I'm not familiar with supertest but if @rmg or @bajtos are, maybe you could explain this?

In the meantime, I will look into supertest and try to figure out what's going on.

@jannyHou
Copy link
Contributor

@richardpringle thanks! It makes sense why there are duplicate failures. Yesterday I searched 'Cannot read property 'currentRetry' of undefined' but got few result, while now it's pretty clear. I will look into supertest and see how to solve the conflict.

Update:
Some test files have conflict.

A testing list as this one could pass on all systems.

But running rest.middleware.test.js and rest.test.js together would cause error.

For example, test case 'includes loopback.token when necessary'(the first error) will return 401 instead of 200, but when I debug it the token.id was successfully set.

@bajtos could you give me some clue about why there is a conflict here? Is it caused by running multiple apps async and expose them to REST? Thanks!

Error details:

 1) loopback.rest includes loopback.token when necessary:
     Error: expected 200 "OK", got 401 "Unauthorized"
      at Test.assert (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\lib\test.js:205:15)
      at Server.assert (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\lib\test.js:132:12)
      at emitCloseNT (net.js:1524:8)
      at C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\continuation-local-storage\node_modules\async-listener\glue.js:188:31
  ---------------------------------------------
      at Server.close (net.js:1480:12)
      at C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\lib\test.js:127:31
      at Test.Request.callback (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\node_modules\superagent\lib\node\index.js:746:30)
      at Test.<anonymous> (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\node_modules\superagent\lib\node\index.js:135:10)
      at IncomingMessage.<anonymous> (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\node_modules\superagent\lib\node\index.js:938:12)
      at endReadableNT (_stream_readable.js:905:12)
      at C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\continuation-local-storage\node_modules\async-listener\glue.js:188:31
  ---------------------------------------------
      at Test.Request (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\node_modules\superagent\lib\node\index.js:134:8)
      at new Test (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\lib\test.js:29:11)
      at Object.obj.(anonymous function) [as get] (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\index.js:25:14)
      at C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\test\rest.middleware.test.js:153:20
      at tokenHandler (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\common\models\user.js:233:9)
      at C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\relation-definition.js:1814:13
      at C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\dao.js:372:19
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at Function.ObserverMixin._notifyBaseObservers (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:116:5)
      at Function.ObserverMixin.notifyObserversOf (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:91:8)
      at Function.ObserverMixin._notifyBaseObservers (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:114:15)
  ---------------------------------------------
      at Memory.saveToFile (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\connectors\memory.js:180:13)
      at C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\connectors\memory.js:229:10
      at Memory._createSync (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\connectors\memory.js:218:3)
      at Memory.create (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\connectors\memory.js:223:8)
      at C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\dao.js:392:23
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at Function.ObserverMixin._notifyBaseObservers (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:116:5)
      at Function.ObserverMixin.notifyObserversOf (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:91:8)
      at Function.ObserverMixin._notifyBaseObservers (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:114:15)
      at Function.ObserverMixin.notifyObserversOf (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:91:8)
      at Function.ObserverMixin._notifyBaseObservers (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:114:15)

  2) loopback.rest context propagation should enable context using loopback.context:
     Error: expected 200 "OK", got 401 "Unauthorized"
      at Test.assert (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\lib\test.js:205:15)
      at Server.assert (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\lib\test.js:132:12)
      at emitCloseNT (net.js:1524:8)
      at C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\continuation-local-storage\node_modules\async-listener\glue.js:188:31
  ---------------------------------------------
      at Server.close (net.js:1480:12)
      at C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\lib\test.js:127:31
      at Test.Request.callback (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\node_modules\superagent\lib\node\index.js:746:30)
      at Test.<anonymous> (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\node_modules\superagent\lib\node\index.js:135:10)
      at IncomingMessage.<anonymous> (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\node_modules\superagent\lib\node\index.js:938:12)
      at endReadableNT (_stream_readable.js:905:12)
      at C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\continuation-local-storage\node_modules\async-listener\glue.js:188:31
  ---------------------------------------------
      at Test.Request (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\node_modules\superagent\lib\node\index.js:134:8)
      at new Test (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\lib\test.js:29:11)
      at Object.obj.(anonymous function) [as get] (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\index.js:25:14)
      at C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\test\rest.middleware.test.js:258:22
      at tokenHandler (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\common\models\user.js:233:9)
      at C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\relation-definition.js:1814:13
      at C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\dao.js:372:19
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at Function.ObserverMixin._notifyBaseObservers (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:116:5)
      at Function.ObserverMixin.notifyObserversOf (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:91:8)
      at Function.ObserverMixin._notifyBaseObservers (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:114:15)
  ---------------------------------------------
      at Memory.saveToFile (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\connectors\memory.js:180:13)
      at C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\connectors\memory.js:229:10
      at Memory._createSync (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\connectors\memory.js:218:3)
      at Memory.create (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\connectors\memory.js:223:8)
      at C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\dao.js:392:23
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at Function.ObserverMixin._notifyBaseObservers (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:116:5)
      at Function.ObserverMixin.notifyObserversOf (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:91:8)
      at Function.ObserverMixin._notifyBaseObservers (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:114:15)
      at Function.ObserverMixin.notifyObserversOf (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:91:8)
      at Function.ObserverMixin._notifyBaseObservers (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:114:15)

  3) loopback.rest context propagation should enable context with loopback.rest:
     Error: expected 200 "OK", got 401 "Unauthorized"
      at Test.assert (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\lib\test.js:205:15)
      at Server.assert (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\lib\test.js:132:12)
      at emitCloseNT (net.js:1524:8)
      at C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\continuation-local-storage\node_modules\async-listener\glue.js:188:31
  ---------------------------------------------
      at Server.close (net.js:1480:12)
      at C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\lib\test.js:127:31
      at Test.Request.callback (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\node_modules\superagent\lib\node\index.js:746:30)
      at Test.<anonymous> (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\node_modules\superagent\lib\node\index.js:135:10)
      at IncomingMessage.<anonymous> (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\node_modules\superagent\lib\node\index.js:938:12)
      at endReadableNT (_stream_readable.js:905:12)
      at C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\continuation-local-storage\node_modules\async-listener\glue.js:188:31
  ---------------------------------------------
      at Test.Request (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\node_modules\superagent\lib\node\index.js:134:8)
      at new Test (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\lib\test.js:29:11)
      at Object.obj.(anonymous function) [as get] (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\index.js:25:14)
      at C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\test\rest.middleware.test.js:258:22
      at tokenHandler (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\common\models\user.js:233:9)
      at C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\relation-definition.js:1814:13
      at C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\dao.js:372:19
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at Function.ObserverMixin._notifyBaseObservers (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:116:5)
      at Function.ObserverMixin.notifyObserversOf (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:91:8)
      at Function.ObserverMixin._notifyBaseObservers (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:114:15)
  ---------------------------------------------
      at Memory.saveToFile (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\connectors\memory.js:180:13)
      at C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\connectors\memory.js:229:10
      at Memory._createSync (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\connectors\memory.js:218:3)
      at Memory.create (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\connectors\memory.js:223:8)
      at C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\dao.js:392:23
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at Function.ObserverMixin._notifyBaseObservers (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:116:5)
      at Function.ObserverMixin.notifyObserversOf (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:91:8)
      at Function.ObserverMixin._notifyBaseObservers (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:114:15)
      at Function.ObserverMixin.notifyObserversOf (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:91:8)
      at Function.ObserverMixin._notifyBaseObservers (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:114:15)

  4) loopback.rest context propagation should support explicit context:
     Error: expected 200 "OK", got 401 "Unauthorized"
      at Test.assert (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\lib\test.js:205:15)
      at Server.assert (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\lib\test.js:132:12)
      at emitCloseNT (net.js:1524:8)
      at C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\continuation-local-storage\node_modules\async-listener\glue.js:188:31
  ---------------------------------------------
      at Server.close (net.js:1480:12)
      at C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\lib\test.js:127:31
      at Test.Request.callback (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\node_modules\superagent\lib\node\index.js:746:30)
      at Test.<anonymous> (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\node_modules\superagent\lib\node\index.js:135:10)
      at IncomingMessage.<anonymous> (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\node_modules\superagent\lib\node\index.js:938:12)
      at endReadableNT (_stream_readable.js:905:12)
      at C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\continuation-local-storage\node_modules\async-listener\glue.js:188:31
  ---------------------------------------------
      at Test.Request (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\node_modules\superagent\lib\node\index.js:134:8)
      at new Test (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\lib\test.js:29:11)
      at Object.obj.(anonymous function) [as get] (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\supertest\index.js:25:14)
      at C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\test\rest.middleware.test.js:258:22
      at tokenHandler (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\common\models\user.js:233:9)
      at C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\relation-definition.js:1814:13
      at C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\dao.js:372:19
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at Function.ObserverMixin._notifyBaseObservers (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:116:5)
      at Function.ObserverMixin.notifyObserversOf (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:91:8)
      at Function.ObserverMixin._notifyBaseObservers (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:114:15)
  ---------------------------------------------
      at Memory.saveToFile (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\connectors\memory.js:180:13)
      at C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\connectors\memory.js:229:10
      at Memory._createSync (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\connectors\memory.js:218:3)
      at Memory.create (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\connectors\memory.js:223:8)
      at C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\dao.js:392:23
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at doNotify (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:93:49)
      at Function.ObserverMixin._notifyBaseObservers (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:116:5)
      at Function.ObserverMixin.notifyObserversOf (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:91:8)
      at Function.ObserverMixin._notifyBaseObservers (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:114:15)
      at Function.ObserverMixin.notifyObserversOf (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:91:8)
      at Function.ObserverMixin._notifyBaseObservers (C:\Users\IBM_ADMIN\Desktop\loopback-supertest\loopback\node_modules\loopback-datasource-juggler\lib\observer.js:114:15)

@bajtos
Copy link
Member

bajtos commented Feb 4, 2016

Related: #2034

@bajtos
Copy link
Member

bajtos commented Feb 5, 2016

I believe all problems should be fixed by now, see #2036, #2035, #2034, and #2030. I am closing this PR as no longer relevant.

@bajtos bajtos closed this Feb 5, 2016
@bajtos bajtos removed the #wip label Feb 5, 2016
@jannyHou
Copy link
Contributor

jannyHou commented Feb 5, 2016

@bajtos thank you!

@jannyHou jannyHou deleted the safer-tests branch May 2, 2016 20:26
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.

4 participants