Skip to content

Commit

Permalink
release 0.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
veny committed Dec 21, 2015
1 parent 4ca09f7 commit 4e81f7a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 20 deletions.
2 changes: 1 addition & 1 deletion lib/gearmanode/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


exports.VERSION_HISTORY = [
['0.9.2', '2015-12-22', 'PR #41'],
['0.9.2', '2015-12-21', 'PR #41'],
['0.9.1', '2015-06-28', 'PR #35, Enh #24'],
['0.9.0', '2015-06-19', 'PR #29, fully implemented Gearman Protocol'],
['0.2.2', '2015-02-04', 'BF #26'],
Expand Down
36 changes: 17 additions & 19 deletions test/test-job-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ describe('JobServer', function() {
var chunk1 = new Buffer([0x00, 0x52, 0x45, 0x53, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00]); // NOOP
var chunk2 = new Buffer([0x00, 0x52, 0x45, 0x53, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00]); // NO_JOB
var chunk = Buffer.concat([chunk1, chunk2]);
var counter = 0;
js.clientOrWorker._response = sinon.spy();
js.connected = true;
js._processData(chunk);
Expand All @@ -260,24 +259,23 @@ describe('JobServer', function() {
done();
})
})
// it('should process more packet with one messages correctly', function() {
// var chunk1 = new Buffer([0x00, 0x52, 0x45, 0x53, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00]); // JOB_ASSIGN
// var chunk2 = new Buffer([0x00, 0x52, 0x45, 0x53, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00]); //
// var chunk = Buffer.concat([chunk1, chunk2]);
// var counter = 0;
// js.clientOrWorker._response = sinon.spy();
// js.connected = true;
// js._processData(chunk);
// // '_processData' works recursively in this case; the second call is via 'process.nextTick'
// // so the asserts must be in the next tick
// process.nextTick(function() {
// should.not.exist(js.segmentedPacket);
// should.not.exist(js.headerfrag);
// js.clientOrWorker._response.calledTwice.should.be.true;
// js.clientOrWorker._response.getCall(0).args[1].should.equal(protocol.PACKET_TYPES.NOOP);
// })
// })
it('PR 41: should concatenate message with header splitted into two', function() {
it('should process more packet with one messages correctly', function() {
var chunk1 = new Buffer([0x00, 0x52, 0x45, 0x53, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x14]); // JOB_ASSIGN
var chunk2 = new Buffer([0x48, 0x3a, 0x6c, 0x61, 0x70, 0x3a, 0x31, 0x00, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x00,
0x74, 0x65, 0x73, 0x74]);
js.clientOrWorker._response = sinon.spy();
js.connected = true;
js._processData(chunk1);
should.exist(js.segmentedPacket);
should.not.exist(js.headerfrag);
js.clientOrWorker._response.called.should.be.false;
js._processData(chunk2);
should.not.exist(js.segmentedPacket);
should.not.exist(js.headerfrag);
js.clientOrWorker._response.calledOnce.should.be.true;
js.clientOrWorker._response.getCall(0).args[1].should.equal(protocol.PACKET_TYPES.JOB_ASSIGN);
})
it('PR 41: should concatenate one message with header splitted into two packets', function() {
var chunk1 = new Buffer([0x00, 0x52, 0x45]);
var chunk2 = new Buffer([0x53, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, // NOOP
0x00, 0x00, 0x00]); // + 3 bytes to be >= 12
Expand Down

0 comments on commit 4e81f7a

Please sign in to comment.