mirror of
https://github.com/status-im/nim-codex.git
synced 2025-01-27 11:05:52 +00:00
adjust timing of integration tests
reason: with the increased period length of 90 seconds, it can take longer to wait for a stable challenge at the beginning of a period.
This commit is contained in:
parent
523e8cbb2a
commit
90e3686d1b
@ -23,9 +23,9 @@ marketplacesuite "Bug #821 - node crashes during erasure coding":
|
|||||||
.some,
|
.some,
|
||||||
):
|
):
|
||||||
let reward = 400.u256
|
let reward = 400.u256
|
||||||
let duration = 10.periods
|
let duration = 20.periods
|
||||||
let collateral = 200.u256
|
let collateral = 200.u256
|
||||||
let expiry = 5.periods
|
let expiry = 10.periods
|
||||||
let data = await RandomChunker.example(blocks=8)
|
let data = await RandomChunker.example(blocks=8)
|
||||||
let client = clients()[0]
|
let client = clients()[0]
|
||||||
let clientApi = client.client
|
let clientApi = client.client
|
||||||
|
@ -24,15 +24,15 @@ twonodessuite "Marketplace", debug1 = false, debug2 = false:
|
|||||||
let cid = client1.upload(data).get
|
let cid = client1.upload(data).get
|
||||||
let id = client1.requestStorage(
|
let id = client1.requestStorage(
|
||||||
cid,
|
cid,
|
||||||
duration=10*60.u256,
|
duration=20*60.u256,
|
||||||
reward=400.u256,
|
reward=400.u256,
|
||||||
proofProbability=3.u256,
|
proofProbability=3.u256,
|
||||||
expiry=5*60,
|
expiry=10*60,
|
||||||
collateral=200.u256,
|
collateral=200.u256,
|
||||||
nodes = 5,
|
nodes = 3,
|
||||||
tolerance = 2).get
|
tolerance = 1).get
|
||||||
|
|
||||||
check eventually(client1.purchaseStateIs(id, "started"), timeout=5*60*1000)
|
check eventually(client1.purchaseStateIs(id, "started"), timeout=10*60*1000)
|
||||||
let purchase = client1.getPurchase(id).get
|
let purchase = client1.getPurchase(id).get
|
||||||
check purchase.error == none string
|
check purchase.error == none string
|
||||||
let availabilities = client2.getAvailabilities().get
|
let availabilities = client2.getAvailabilities().get
|
||||||
@ -41,7 +41,7 @@ twonodessuite "Marketplace", debug1 = false, debug2 = false:
|
|||||||
check newSize > 0 and newSize < size
|
check newSize > 0 and newSize < size
|
||||||
|
|
||||||
let reservations = client2.getAvailabilityReservations(availability.id).get
|
let reservations = client2.getAvailabilityReservations(availability.id).get
|
||||||
check reservations.len == 5
|
check reservations.len == 3
|
||||||
check reservations[0].requestId == purchase.requestId
|
check reservations[0].requestId == purchase.requestId
|
||||||
|
|
||||||
test "node slots gets paid out and rest of tokens are returned to client":
|
test "node slots gets paid out and rest of tokens are returned to client":
|
||||||
@ -51,8 +51,8 @@ twonodessuite "Marketplace", debug1 = false, debug2 = false:
|
|||||||
let tokenAddress = await marketplace.token()
|
let tokenAddress = await marketplace.token()
|
||||||
let token = Erc20Token.new(tokenAddress, ethProvider.getSigner())
|
let token = Erc20Token.new(tokenAddress, ethProvider.getSigner())
|
||||||
let reward = 400.u256
|
let reward = 400.u256
|
||||||
let duration = 10*60.u256
|
let duration = 20*60.u256
|
||||||
let nodes = 5'u
|
let nodes = 3'u
|
||||||
|
|
||||||
# client 2 makes storage available
|
# client 2 makes storage available
|
||||||
let startBalanceHost = await token.balanceOf(account2)
|
let startBalanceHost = await token.balanceOf(account2)
|
||||||
@ -65,12 +65,12 @@ twonodessuite "Marketplace", debug1 = false, debug2 = false:
|
|||||||
duration=duration,
|
duration=duration,
|
||||||
reward=reward,
|
reward=reward,
|
||||||
proofProbability=3.u256,
|
proofProbability=3.u256,
|
||||||
expiry=5*60,
|
expiry=10*60,
|
||||||
collateral=200.u256,
|
collateral=200.u256,
|
||||||
nodes = nodes,
|
nodes = nodes,
|
||||||
tolerance = 2).get
|
tolerance = 1).get
|
||||||
|
|
||||||
check eventually(client1.purchaseStateIs(id, "started"), timeout=5*60*1000)
|
check eventually(client1.purchaseStateIs(id, "started"), timeout=10*60*1000)
|
||||||
let purchase = client1.getPurchase(id).get
|
let purchase = client1.getPurchase(id).get
|
||||||
check purchase.error == none string
|
check purchase.error == none string
|
||||||
|
|
||||||
@ -112,9 +112,9 @@ marketplacesuite "Marketplace payouts":
|
|||||||
.some,
|
.some,
|
||||||
):
|
):
|
||||||
let reward = 400.u256
|
let reward = 400.u256
|
||||||
let duration = 10.periods
|
let duration = 20.periods
|
||||||
let collateral = 200.u256
|
let collateral = 200.u256
|
||||||
let expiry = 5.periods
|
let expiry = 10.periods
|
||||||
let data = await RandomChunker.example(blocks=8)
|
let data = await RandomChunker.example(blocks=8)
|
||||||
let client = clients()[0]
|
let client = clients()[0]
|
||||||
let provider = providers()[0]
|
let provider = providers()[0]
|
||||||
|
@ -36,7 +36,7 @@ marketplacesuite "Hosts submit regular proofs":
|
|||||||
.some,
|
.some,
|
||||||
):
|
):
|
||||||
let client0 = clients()[0].client
|
let client0 = clients()[0].client
|
||||||
let expiry = 5.periods
|
let expiry = 10.periods
|
||||||
let duration = expiry + 5.periods
|
let duration = expiry + 5.periods
|
||||||
|
|
||||||
let data = await RandomChunker.example(blocks=8)
|
let data = await RandomChunker.example(blocks=8)
|
||||||
@ -99,7 +99,7 @@ marketplacesuite "Simulate invalid proofs":
|
|||||||
.some
|
.some
|
||||||
):
|
):
|
||||||
let client0 = clients()[0].client
|
let client0 = clients()[0].client
|
||||||
let expiry = 5.periods
|
let expiry = 10.periods
|
||||||
let duration = expiry + 10.periods
|
let duration = expiry + 10.periods
|
||||||
|
|
||||||
let data = await RandomChunker.example(blocks=8)
|
let data = await RandomChunker.example(blocks=8)
|
||||||
@ -157,7 +157,7 @@ marketplacesuite "Simulate invalid proofs":
|
|||||||
.some
|
.some
|
||||||
):
|
):
|
||||||
let client0 = clients()[0].client
|
let client0 = clients()[0].client
|
||||||
let expiry = 5.periods
|
let expiry = 10.periods
|
||||||
let duration = expiry + 10.periods
|
let duration = expiry + 10.periods
|
||||||
|
|
||||||
let data = await RandomChunker.example(blocks=8)
|
let data = await RandomChunker.example(blocks=8)
|
||||||
|
@ -60,15 +60,15 @@ twonodessuite "Sales", debug1 = false, debug2 = false:
|
|||||||
let cid = client2.upload(data).get
|
let cid = client2.upload(data).get
|
||||||
let id = client2.requestStorage(
|
let id = client2.requestStorage(
|
||||||
cid,
|
cid,
|
||||||
duration=10*60.u256,
|
duration=20*60.u256,
|
||||||
reward=400.u256,
|
reward=400.u256,
|
||||||
proofProbability=3.u256,
|
proofProbability=3.u256,
|
||||||
expiry=5*60,
|
expiry=10*60,
|
||||||
collateral=200.u256,
|
collateral=200.u256,
|
||||||
nodes = 3,
|
nodes = 3,
|
||||||
tolerance = 1).get
|
tolerance = 1).get
|
||||||
|
|
||||||
check eventually(client2.purchaseStateIs(id, "started"), timeout=5*60*1000)
|
check eventually(client2.purchaseStateIs(id, "started"), timeout=10*60*1000)
|
||||||
let updatedAvailability = (client1.getAvailabilities().get).findItem(availability).get
|
let updatedAvailability = (client1.getAvailabilities().get).findItem(availability).get
|
||||||
check updatedAvailability.totalSize != updatedAvailability.freeSize
|
check updatedAvailability.totalSize != updatedAvailability.freeSize
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user