logux / server

Build your own Logux server or make a proxy between a WebSocket and an HTTP backend in any language

Home Page:https://logux.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tests fails on Linux

sairus2k opened this issue · comments

OS: Ubuntu 16.04 xenial x86_64
Kernel: 4.8.0-56-generic

I have cloned the repo, install packages and test.

$ yarn test
yarn test v0.24.5
$ jest --coverage && yarn run lint && yarn run spellcheck
PASS test/human-reporter.test.js
PASS test/base-server.test.js
PASS test/bunyan-reporter.test.js
FAIL test/server-client.test.js
● sends old actions by node ID

expect(received).toEqual(expected)

Expected value to equal:
  ["sync", 2, {"type": "FOO"}, {"id": [2, "server:uuid", 0], "time": 2}]
Received:
  ["sync", 2, {"type": "FOO"}, {"id": [2, "server:uuid", 0], "time": 2}, {"type": "FOO"}, {"id": [1, "server:uuid", 0], "time": 1}]

Difference:

- Expected
+ Received

@@ -10,6 +10,17 @@
       "server:uuid",
       0,
     ],
     "time": 2,
   },
+  Object {
+    "type": "FOO",
+  },
+  Object {
+    "id": Array [
+      1,
+      "server:uuid",
+      0,
+    ],
+    "time": 1,
+  },
 ]
  
  at client.sync.waitFor.then (test/server-client.test.js:463:31)
      at <anonymous>

● sends old actions by user

expect(received).toEqual(expected)

Expected value to equal:
  ["sync", 2, {"type": "FOO"}, {"id": [2, "server:uuid", 0], "time": 2}]
Received:
  ["sync", 2, {"type": "FOO"}, {"id": [2, "server:uuid", 0], "time": 2}, {"type": "FOO"}, {"id": [1, "server:uuid", 0], "time": 1}]                                                                                                                       

Difference:

- Expected
+ Received

@@ -10,6 +10,17 @@
       "server:uuid",
       0,
     ],
     "time": 2,
   },
+  Object {
+    "type": "FOO",
+  },
+  Object {
+    "id": Array [
+      1,
+      "server:uuid",
+      0,
+    ],
+    "time": 1,
+  },
 ]
  
  at client.sync.waitFor.then (test/server-client.test.js:505:31)
      at <anonymous>

PASS test/force-promise.test.js
PASS test/promisify.test.js
PASS test/index.test.js
FAIL test/filtered-sync.test.js (5.167s)
● does not sync actions on add

Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
  
  at pTimeout (node_modules/jest-jasmine2/build/queueRunner.js:53:21)
  at Timeout.callback [as _onTimeout] (node_modules/jsdom/lib/jsdom/browser/Window.js:523:19)
  at ontimeout (timers.js:488:11)
  at tryOnTimeout (timers.js:323:5)
  at Timer.listOnTimeout (timers.js:283:5)

● synchronizes only node-specific actions on connection

expect(received).toEqual(expected)

Expected value to equal:
  [{"type": "B"}]
Received:
  [{"type": "C"}, {"type": "B"}, {"type": "A"}]

Difference:

- Expected
+ Received

 Array [
   Object {
+    "type": "C",
+  },
+  Object {
     "type": "B",
   },
+  Object {
+    "type": "A",
+  },
 ]
  
  at Promise.all.then.then.then (test/filtered-sync.test.js:56:34)
      at <anonymous>

● synchronizes only user-specific actions on connection

expect(received).toEqual(expected)

Expected value to equal:
  [{"type": "B"}]
Received:
  [{"type": "C"}, {"type": "B"}, {"type": "A"}]

Difference:

- Expected
+ Received

 Array [
   Object {
+    "type": "C",
+  },
+  Object {
     "type": "B",
   },
+  Object {
+    "type": "A",
+  },
 ]
  
  at Promise.all.then.then.then (test/filtered-sync.test.js:71:34)
      at <anonymous>

PASS test/server.test.js (6.438s)

Test Suites: 2 failed, 7 passed, 9 total
Tests: 5 failed, 153 passed, 158 total
Snapshots: 65 passed, 65 total
Time: 10.578s

@sairus2k it is Yarn cache problem (sometimes cache uses old version of dependency if you are taking it by Git). This will solve the problem:

yarn cache clean
rm -R node_modules
yarn