Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
Merge pull request #745 from braydonf/master
Browse files Browse the repository at this point in the history
Fix race condition on test
  • Loading branch information
braydonf committed Oct 25, 2017
2 parents 8775091 + 3b3dfe5 commit 5b8b795
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions test/network/farmer.unit.js
Expand Up @@ -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(),
Expand All @@ -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({
Expand Down

0 comments on commit 5b8b795

Please sign in to comment.