From 3b3dfe5904bf7dac06e2e023f4340906ef03d380 Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Wed, 25 Oct 2017 12:27:52 -0400 Subject: [PATCH] Fix race condition on test --- test/network/farmer.unit.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/test/network/farmer.unit.js b/test/network/farmer.unit.js index ec6fa254..67c88ae8 100644 --- a/test/network/farmer.unit.js +++ b/test/network/farmer.unit.js @@ -973,9 +973,6 @@ describe('FarmerInterface', function() { }); describe('#handleAlloc', function() { - const sandbox = sinon.sandbox.create(); - afterEach(() => sandbox.restore()); - it('should reset contract count to 0 to prevent overflow', function(done) { farmer = new FarmerInterface({ keyPair: KeyPair(), @@ -986,8 +983,9 @@ describe('FarmerInterface', function() { storagePath: tmpPath, storageManager: new StorageManager(new RAMStorageAdapter()) }); - sandbox.stub(farmer, '_shouldSendOffer').callsArgWith(1, true); - sandbox.stub(farmer.storageManager, 'save').callsArgWith(1, null); + sinon.stub(farmer, '_shouldSendOffer').callsArgWith(1, true); + sinon.stub(farmer.storageManager, 'save').callsArgWith(1, null); + sinon.stub(farmer.transport.shardServer, 'accept'); farmer._contractCount = Number.MAX_SAFE_INTEGER; farmer.handleAlloc({ contract: Contract({