From 15d9948552b27a9f46c541bd5d116e022e43cfb8 Mon Sep 17 00:00:00 2001 From: Jamie Hewitt Date: Fri, 24 Mar 2023 14:14:24 +0300 Subject: [PATCH] Revert "Increasing sleep times" This reverts commit dc21fcdf8d524970012f4f076086bf4b539039d9. --- test/integration/DFRewards.test.ts | 4 ++-- test/integration/Datatoken.test.ts | 14 +++++++------- test/integration/Dispenser.test.ts | 2 +- test/integration/FactoryRouter.test.ts | 4 ++-- test/integration/FixedRateExchange.test.ts | 2 +- test/integration/Nft.test.ts | 8 ++++---- test/integration/SimplePublishConsume.test.ts | 14 +++++++------- test/integration/SimpleSubgraph.test.ts | 6 +++--- test/integration/VeOcean.test.ts | 10 +++++----- test/integration/users.test.ts | 4 ++-- 10 files changed, 34 insertions(+), 34 deletions(-) diff --git a/test/integration/DFRewards.test.ts b/test/integration/DFRewards.test.ts index ac5d2de..2c9e97f 100644 --- a/test/integration/DFRewards.test.ts +++ b/test/integration/DFRewards.test.ts @@ -130,7 +130,7 @@ describe('DFRewards tests', async () => { datatokenAddress1 ) // check subgraph - await sleep(3000) + await sleep(2000) const initialQuery = { query: `query { dfrewards(where: {id:"${user1.toLowerCase()}"}){ @@ -190,7 +190,7 @@ describe('DFRewards tests', async () => { datatokenAddress1 ) // check subgraph - await sleep(3000) + await sleep(2000) const initialQuery = { query: `query { dfrewards(where: {id:"${user2.toLowerCase()}"}){ diff --git a/test/integration/Datatoken.test.ts b/test/integration/Datatoken.test.ts index 30b7388..24d30a3 100644 --- a/test/integration/Datatoken.test.ts +++ b/test/integration/Datatoken.test.ts @@ -135,7 +135,7 @@ describe('Datatoken tests', async () => { datatokenAddress = result.events.TokenCreated.returnValues[0].toLowerCase() // Check values before updating metadata - await sleep(3000) + await sleep(2000) const initialQuery = { query: `query { token(id: "${datatokenAddress}"){ @@ -169,7 +169,7 @@ describe('Datatoken tests', async () => { method: 'POST', body: JSON.stringify(initialQuery) }) - await sleep(3000) + await sleep(2000) const dt = (await initialResponse.json()).data.token const tx: TransactionReceipt = await web3.eth.getTransactionReceipt(dt.tx) @@ -247,7 +247,7 @@ describe('Datatoken tests', async () => { ) // Check values before updating metadata - await sleep(3000) + await sleep(2000) const initialQuery = { query: `query { token(id: "${datatokenAddress}"){ @@ -281,7 +281,7 @@ describe('Datatoken tests', async () => { method: 'POST', body: JSON.stringify(initialQuery) }) - await sleep(3000) + await sleep(2000) const dt = (await initialResponse.json()).data.token const tx: TransactionReceipt = await web3.eth.getTransactionReceipt(dt.tx) @@ -351,7 +351,7 @@ describe('Datatoken tests', async () => { nftParams, erc20Params ) - await sleep(3000) + await sleep(2000) const newDtAddress = result.events.TokenCreated.returnValues[0] const datatoken = new Datatoken(web3, 8996) @@ -365,7 +365,7 @@ describe('Datatoken tests', async () => { query: `query {token(id: "${newDtAddress.toLowerCase()}"){id,orderCount,orders {id, nftOwner{id}, lastPriceToken{id}}}}` } - await sleep(3000) + await sleep(2000) let response = await fetch(subgraphUrl, { method: 'POST', body: JSON.stringify(query) @@ -411,7 +411,7 @@ describe('Datatoken tests', async () => { assert(orderTx, 'Invalid orderTx') const orderId = `${orderTx.transactionHash.toLowerCase()}-${newDtAddress.toLowerCase()}-${user1.toLowerCase()}` - await sleep(3000) + await sleep(2000) response = await fetch(subgraphUrl, { method: 'POST', body: JSON.stringify(query) diff --git a/test/integration/Dispenser.test.ts b/test/integration/Dispenser.test.ts index e7a608d..763ffe8 100644 --- a/test/integration/Dispenser.test.ts +++ b/test/integration/Dispenser.test.ts @@ -18,7 +18,7 @@ import { fetch } from 'cross-fetch' import { TransactionReceipt } from 'web3-core' import { AbiItem } from 'web3-utils/types' -const sleepMs = 3000 +const sleepMs = 1800 const data = JSON.parse( fs.readFileSync( diff --git a/test/integration/FactoryRouter.test.ts b/test/integration/FactoryRouter.test.ts index e740efe..0c03b85 100644 --- a/test/integration/FactoryRouter.test.ts +++ b/test/integration/FactoryRouter.test.ts @@ -149,7 +149,7 @@ describe('FactoryRouter tests', async () => { ) datatokenAddress = result.events.TokenCreated.returnValues[0].toLowerCase() await router.addApprovedToken(ownerAccount, datatokenAddress) - await sleep(3000) + await sleep(2000) const tokens = await getSubgraphApprovedTokens() assert(tokens.includes(datatokenAddress.toLowerCase())) assert(tokens.length === 2) @@ -157,7 +157,7 @@ describe('FactoryRouter tests', async () => { it('Owner should remove token from the approved list', async () => { await router.removeApprovedToken(ownerAccount, datatokenAddress) - await sleep(3000) + await sleep(2000) const tokens = await getSubgraphApprovedTokens() assert(!tokens.includes(datatokenAddress.toLowerCase())) assert(tokens.length === 1) diff --git a/test/integration/FixedRateExchange.test.ts b/test/integration/FixedRateExchange.test.ts index 35f63e2..278f4cd 100644 --- a/test/integration/FixedRateExchange.test.ts +++ b/test/integration/FixedRateExchange.test.ts @@ -18,7 +18,7 @@ import { TransactionReceipt } from 'web3-core' import { AbiItem } from 'web3-utils/types' import BN from 'bn.js' -const sleepMs = 3000 +const sleepMs = 1700 const data = JSON.parse( fs.readFileSync( diff --git a/test/integration/Nft.test.ts b/test/integration/Nft.test.ts index 0cd3d52..ae4abd3 100644 --- a/test/integration/Nft.test.ts +++ b/test/integration/Nft.test.ts @@ -121,7 +121,7 @@ describe('NFT tests', async () => { datatokenAddress = result.events.TokenCreated.returnValues[0] // Check values before updating metadata - await sleep(3000) + await sleep(2000) nftAddress = erc721Address.toLowerCase() const initialQuery = { query: `query { @@ -150,7 +150,7 @@ describe('NFT tests', async () => { method: 'POST', body: JSON.stringify(initialQuery) }) - await sleep(3000) + await sleep(2000) const nft = (await initialResponse.json()).data.nft const tx: TransactionReceipt = await web3.eth.getTransactionReceipt(nft.tx) assert(nft.id === nftAddress, 'incorrect value for: id') @@ -215,7 +215,7 @@ describe('NFT tests', async () => { ) // graph tests here - await sleep(3000) + await sleep(2000) const query = { query: `query { nft(id:"${nftAddress}"){ @@ -292,7 +292,7 @@ describe('NFT tests', async () => { it('Set a key/value in erc725 store', async () => { await nft.setData(nftAddress, publisher, 'test_key', 'test_value') - await sleep(3000) + await sleep(2000) const query = { query: `query { nft(id:"${nftAddress}"){ diff --git a/test/integration/SimplePublishConsume.test.ts b/test/integration/SimplePublishConsume.test.ts index a433732..17ee0e4 100644 --- a/test/integration/SimplePublishConsume.test.ts +++ b/test/integration/SimplePublishConsume.test.ts @@ -152,7 +152,7 @@ describe('Simple Publish & consume test', async () => { ) // graph tests here - await sleep(3000) + await sleep(2000) const graphNftToken = erc721Address.toLowerCase() const query = { query: `query { @@ -188,7 +188,7 @@ describe('Simple Publish & consume test', async () => { nftParams, erc20Params ) - await sleep(3000) + await sleep(2000) const erc721Address = result.events.NFTCreated.returnValues[0] const datatokenAddress = result.events.TokenCreated.returnValues[0] const graphNftToken = erc721Address.toLowerCase() @@ -235,11 +235,11 @@ describe('Simple Publish & consume test', async () => { encryptedResponse, '0x' + metadataHash ) - await sleep(3000) + await sleep(2000) // Transfer the NFT await nft.transferNft(graphNftToken, publisherAccount, newOwnerAccount) - await sleep(3000) + await sleep(2000) const query2 = { query: `query { nft(id:"${graphNftToken}"){symbol,id,owner{id}, transferable}}` @@ -293,7 +293,7 @@ describe('Simple Publish & consume test', async () => { query: `query {order(id:"${orderId}"){id, providerFee, lastPriceToken{id}}}` } - await sleep(3000) + await sleep(2000) const response = await fetch(subgraphUrl, { method: 'POST', body: JSON.stringify(query) @@ -366,7 +366,7 @@ describe('Simple Publish & consume test', async () => { const initialQuery = { query: `query {order(id:"${orderId}"){id, providerFee, lastPriceToken{id}}}` } - await sleep(3000) + await sleep(2000) const initialResponse = await fetch(subgraphUrl, { method: 'POST', body: JSON.stringify(initialQuery) @@ -436,7 +436,7 @@ describe('Simple Publish & consume test', async () => { query: `query {orderReuse(id:"${reusedOrder.transactionHash}"){id, providerFee}}` } - await sleep(3000) + await sleep(2000) const response = await fetch(subgraphUrl, { method: 'POST', body: JSON.stringify(reuseQuery) diff --git a/test/integration/SimpleSubgraph.test.ts b/test/integration/SimpleSubgraph.test.ts index 17b58d5..83a1a28 100644 --- a/test/integration/SimpleSubgraph.test.ts +++ b/test/integration/SimpleSubgraph.test.ts @@ -69,7 +69,7 @@ describe('Tests coverage without provider/aquarius', async () => { const erc721Address = result.events.NFTCreated.returnValues[0] // graph tests here - await sleep(3000) + await sleep(2000) const graphNftToken = erc721Address.toLowerCase() const query = { query: `query { @@ -106,7 +106,7 @@ describe('Tests coverage without provider/aquarius', async () => { nftParams, erc20Params ) - await sleep(3000) + await sleep(2000) const erc721Address = result.events.NFTCreated.returnValues[0] const nftAddress = erc721Address.toLowerCase() @@ -117,7 +117,7 @@ describe('Tests coverage without provider/aquarius', async () => { newOwnerAccount ) - await sleep(3000) + await sleep(2000) const query2 = { query: `query { nft(id:"${nftAddress}"){ diff --git a/test/integration/VeOcean.test.ts b/test/integration/VeOcean.test.ts index 3bf386c..728d51f 100644 --- a/test/integration/VeOcean.test.ts +++ b/test/integration/VeOcean.test.ts @@ -165,7 +165,7 @@ describe('veOcean tests', async () => { } currentBalance = await veOcean.getLockedAmount(Alice) currentLock = await veOcean.lockEnd(Alice) - await sleep(3000) + await sleep(2000) const initialQuery = { query: `query { veOCEANs(id:"${Alice.toLowerCase()}"){ @@ -190,7 +190,7 @@ describe('veOcean tests', async () => { const newLock = parseInt(String(currentLock)) + 7 * 86400 await veOcean.increaseUnlockTime(Alice, newLock) const newCurrentLock = await veOcean.lockEnd(Alice) - await sleep(3000) + await sleep(2000) const initialQuery = { query: `query { veOCEANs(id:"${Alice.toLowerCase()}"){ @@ -227,7 +227,7 @@ describe('veOcean tests', async () => { await veOcean.increaseAmount(Alice, amount) const newCurrentBalance = await veOcean.getLockedAmount(Alice) const newCurrentLock = await veOcean.lockEnd(Alice) - await sleep(3000) + await sleep(2000) const initialQuery = { query: `query { veOCEANs(id:"${Alice.toLowerCase()}"){ @@ -289,7 +289,7 @@ describe('veOcean tests', async () => { it('Alice should allocate 10% to NFT1', async () => { await veAllocate.setAllocation(Alice, '1000', nft1, chainId) const newTotalAllocation = await veAllocate.getTotalAllocation(Alice) - await sleep(3000) + await sleep(2000) let initialQuery = { query: `query { veAllocateUsers(id:"${Alice.toLowerCase()}"){ @@ -341,7 +341,7 @@ describe('veOcean tests', async () => { ) const totalAllocation = await veAllocate.getTotalAllocation(Alice) - await sleep(3000) + await sleep(2000) let initialQuery = { query: `query { veAllocateUsers(id:"${Alice.toLowerCase()}"){ diff --git a/test/integration/users.test.ts b/test/integration/users.test.ts index b9ec09f..afd791b 100644 --- a/test/integration/users.test.ts +++ b/test/integration/users.test.ts @@ -18,7 +18,7 @@ import fs from 'fs' import { fetch } from 'cross-fetch' import { AbiItem } from 'web3-utils/types' -const sleepMs = 3000 +const sleepMs = 1700 const data = JSON.parse( fs.readFileSync( @@ -281,7 +281,7 @@ describe('User tests', async () => { ) assert(orderTx.events.OrderStarted, 'Invalid orderTx') - await sleep(3000) + await sleep(2000) const user = await userQuery(user3) assert(user.id === user3, 'incorrect value for: id')