From 2a8ebc479f6705aad5b0ec8b6c1d30b854580f40 Mon Sep 17 00:00:00 2001 From: C J Silverio Date: Fri, 10 Jan 2014 09:40:29 -0800 Subject: [PATCH] Add a test to attempt to reproduce the behavior described in issue #24. This test passes, so I haven't figured out what the root cause of the problem is yet. --- test/test-client.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/test-client.js b/test/test-client.js index 4dd0e14..fb62b62 100644 --- a/test/test-client.js +++ b/test/test-client.js @@ -165,6 +165,27 @@ describe('FiveBeansClient', function() }); }); + it('consumer can run stats_job() while a job is reserved', function(done) + { + consumer.reserve(function(err, jobid, payload) + { + should.not.exist(err); + consumer.stats_job(jobid, function(err, res) + { + should.not.exist(err); + res.should.be.an('object'); + res.should.have.property('id'); + res.id.should.equal(parseInt(jobid, 10)); + res.state.should.equal('reserved'); + consumer.release(jobid, 1, 1, function(err) + { + should.not.exist(err); + done(); + }); + }); + }); + }); + it('#reserve() returns a job', function(done) { consumer.reserve(function(err, jobid, payload)