From 2994cb5b8a2860a9da11e7a1e4f26a717668a06a Mon Sep 17 00:00:00 2001 From: alexcos20 Date: Tue, 15 Sep 2020 13:19:34 -0700 Subject: [PATCH] add sleep for tests --- test/integration/ComputeFlow.test.ts | 10 ++++++++++ test/integration/Marketplaceflow.test.ts | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/test/integration/ComputeFlow.test.ts b/test/integration/ComputeFlow.test.ts index c87c0735..41d51f3f 100644 --- a/test/integration/ComputeFlow.test.ts +++ b/test/integration/ComputeFlow.test.ts @@ -11,6 +11,12 @@ import factory from '@oceanprotocol/contracts/artifacts/DTFactory.json' import datatokensTemplate from '@oceanprotocol/contracts/artifacts/DataTokenTemplate.json' const web3 = new Web3('http://127.0.0.1:8545') +function sleep(ms) { + return new Promise((resolve) => { + setTimeout(resolve, ms) + }) +} + describe('Compute flow', () => { let owner let bob @@ -156,6 +162,7 @@ describe('Compute flow', () => { ) ddo = await ocean.assets.create(asset, alice, [computeService], tokenAddress) assert(ddo.dataToken === tokenAddress) + await sleep(6000) }) // alex @@ -180,6 +187,7 @@ describe('Compute flow', () => { tokenAddress ) assert(datasetNoRawAlgo.dataToken === tokenAddress) + await sleep(6000) }) it('should publish a dataset with a compute service object that allows only algo with did:op:1234', async () => { @@ -203,6 +211,7 @@ describe('Compute flow', () => { tokenAddress ) assert(datasetWithTrustedAlgo.dataToken === tokenAddress) + await sleep(6000) }) it('should publish an algorithm', async () => { @@ -241,6 +250,7 @@ describe('Compute flow', () => { ) algorithmAsset = await ocean.assets.create(algoAsset, alice, [service1], tokenAddress) assert(algorithmAsset.dataToken === tokenAddress) + await sleep(6000) }) it('Alice mints 100 DTs and tranfers them to the compute marketplace', async () => { diff --git a/test/integration/Marketplaceflow.test.ts b/test/integration/Marketplaceflow.test.ts index 91c683dc..302b46af 100644 --- a/test/integration/Marketplaceflow.test.ts +++ b/test/integration/Marketplaceflow.test.ts @@ -11,6 +11,12 @@ import factory from '@oceanprotocol/contracts/artifacts/DTFactory.json' import datatokensTemplate from '@oceanprotocol/contracts/artifacts/DataTokenTemplate.json' const web3 = new Web3('http://127.0.0.1:8545') +function sleep(ms) { + return new Promise((resolve) => { + setTimeout(resolve, ms) + }) +} + describe('Marketplace flow', () => { let owner let bob @@ -103,6 +109,7 @@ describe('Marketplace flow', () => { ) ddo = await ocean.assets.create(asset, alice, [service1], tokenAddress) assert(ddo.dataToken === tokenAddress) + await sleep(6000) }) it('Alice mints 100 tokens', async () => {