hitchyjs / scull

Raft Consensus for Node.js, backed by LevelDB
MIT License
3 stars 4 forks source link

Support for NodeJS 10.x #6

Closed petermetz closed 5 years ago

petermetz commented 5 years ago

Crash happens in test/passive-network.js:77 ->

    client.encoder.write( { from: client.address, to, what: 'hey' } );  client.encoder.write( { from: client.address, to, what: 'hey' } );
$ node --version
v10.16.3

$ npm test 

> scull@2.0.1 test /some-dir-path/.../scull 
> npm run quick-tests

> scull@2.0.1 quick-tests /some-dir-path/.../scull 
> lab -vl test/active-network.js && lab -vl test/passive-network.js && lab -vl test/incoming-dispatcher.js && lab -vl test/election.js && lab -vl test/log-replication.js && lab -vl test/log-replication-catchup.js && lab -vl test/log-compaction.js && lab -vl test/leveldown.js && lab -vl test/levelup.js && lab -vl 
test/persistence.js && lab -vl test/remote-commands.js && lab -vl test/weakening.js && lab -vl test/log.js && lab -vl test/leakage.js

active network 
  ✔ 1) can be created (4 ms)
  ✔ 2) can be used to send a message to a peer (56 ms) 
  ✔ 3) peer gets the message (3 ms)
  ✔ 4) allows message to unconnected peer (16 ms) 
  ✔ 5) waits a bit (502 ms) 
  ✔ 6) allows peer to disconnect (4 ms)
  ✔ 7) sending a message while trying to reconnect will fail silently (2 ms)
  ✔ 8) can still send data to another peer (9 ms) 
  ✔ 9) waits a bit (501 ms) 
  ✔ 10) can still send data to another peer 2 (8 ms) 
  ✔ 11) peer gets the message (1 ms)
  ✔ 12) can send data to reconnected peer (7 ms) 
  ✔ 13) reconnected peer gets the message (2 ms) 
  ✔ 14) can remove existing peer (2 ms) 
  ✔ 15) can remove non-existing peer (1 ms)
  ✔ 16) waits a bit (501 ms) 
(node:26173) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. 
  ✔ 17) catches errors (516 ms)
  ✔ 18) waits a bit (505 ms) 
  ✔ 19) can get closed (3 ms)

19 tests complete
Test duration: 2858 ms 

passive network 
  ✔ 1) can be created (29 ms)
  ✔ 2) accepts client connections (31 ms) 
node[26180]: ../src/stream_base.cc:200:int node::StreamBase::WriteString(const v8::FunctionCallbackInfo<v8::Value>&) [with node::encoding enc = (node::encoding)1u]: Assertion `args[1]->IsString()' failed. 
 1: 0x8fa0c0 node::Abort() [node] 
 2: 0x8fa195  [node]
 3: 0x9ca544 int node::StreamBase::WriteString<(node::encoding)1>(v8::FunctionCallbackInfo<v8::Value> const&) [node] 
 4: 0x9d1702 void node::StreamBase::JSMethod<node::LibuvStreamWrap, &(int node::StreamBase::WriteString<(node::encoding)1>(v8::FunctionCallbackInfo<v8::Value> const&))>(v8::FunctionCallbackInfo<v8::Value> const&) [node]
 5: 0xb8e6af  [node] 
 6: 0xb8f219 v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*) [node]
 7: 0x1cecd8edbe1d
Aborted (core dumped) 
npm ERR! code ELIFECYCLE 
npm ERR! errno 134 
npm ERR! scull@2.0.1 quick-tests: `lab -vl test/active-network.js && lab -vl test/passive-network.js && lab -vl test/incoming-dispatcher.js && lab -vl test/election.js && lab -vl test/log-replication.js && lab -vl test/log-replication-catchup.js && lab -vl test/log-compaction.js && lab -vl test/leveldown.js && lab -vl test/levelup.js && lab -vl test/persistence.js && lab -vl test/remote-commands.js && lab -vl test/weakening.js && lab -vl test/log.js && lab -vl test/leakage.js`
npm ERR! Exit status 134
npm ERR!  
npm ERR! Failed at the scull@2.0.1 quick-tests script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above. 

npm ERR! A complete log of this run can be found in: 
npm ERR!     /home/someusername/.npm/_logs/2019-10-08T00_07_59_453Z-debug.log
npm ERR! Test failed.  See above for more details. 
soletan commented 5 years ago

Thanks for the report. I will have a look into this.

Note: Resilience tests aren't working at all, thus scull isn't ready for production currently and we are still working on a fix for that as well, though focusing on different projects most of the time.

soletan commented 5 years ago

Basically, your issue is related to current master branch. In development branch there is a reduced, but working set of unit tests. In addition, implementation is very different from master branch. A release has been pending for months because of the resilience test issues mentioned before, though these issues are given in master branch as well as any pre-2.0 release of original project skiff as well.

petermetz commented 5 years ago

@soletan Understood and thank you very much for the info! Closing this as redundant if the development branch already has a fix then no need to have a separate issue tracking it.