Skip to content

Commit 35424ad

Browse files
author
Daisuke Kanda
committed
fix timing in test
Signed-off-by: Daisuke Kanda <daisuke.kanda@datachain.jp>
1 parent 267a375 commit 35424ad

File tree

3 files changed

+23
-12
lines changed

3 files changed

+23
-12
lines changed

tests/cases/tm2tm/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ test:
2121
./scripts/test-create-channel-fail-already-created
2222
./scripts/test-create-channel-fail-unexist
2323
./scripts/test-tx
24+
./scripts/test-tx-fakelost 2
2425
./scripts/test-service
25-
./scripts/test-tx-fakelost
2626
./scripts/test-service-fakelost
2727

2828
.PHONY: network-down

tests/cases/tm2tm/scripts/test-service-fakelost

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ export DEBUG_RELAYER_MISSING_TRIE_NODE_HEIGHT_PROVER_ibc0="10"
2525
export DEBUG_RELAYER_SHFU_WAIT_ibc1="20"
2626

2727
SECONDS=0
28+
date; echo " yyyyyyyy Start yrly service. Call now as @0"
2829
${RLY} service start ibc01 --relay-interval 20s --src-relay-optimize-interval 30s --src-relay-optimize-count 3 --dst-relay-optimize-interval 30s --dst-relay-optimize-count 3 &
2930
RLY_PID=$!
3031

3132
sleep 3
32-
echo " yyyyyyyy Start yrly service. Call current time as 0s"
33+
date; echo " yyyyyyyy Now is @3. Check there are not packets and then send packets. They are ready to be relayed after optimize-interval(30s) at @33"
3334
expectUnrelayedCount "unrelayed-packets" "src" 0
3435
expectUnrelayedCount "unrelayed-packets" "dst" 0
3536
expectUnrelayedCount "unrelayed-acknowledgements" "src" 0
@@ -39,36 +40,41 @@ docker exec tendermint-chain0 sh -c "simd --home /root/data/ibc0 tx --keyring-ba
3940
docker exec tendermint-chain1 sh -c "simd --home /root/data/ibc1 tx --keyring-backend=test --from ${TM_ADDRESS1} --chain-id ibc1 mockapp send mockapp channel-0 'mock packet data' --yes"
4041

4142
sleep 3
42-
echo " yyyyyyyy Now is 3s. Packets are added 3s before."
43+
date; echo " yyyyyyyy Now is @6. Check there are 1 packet on both chain"
4344
expectUnrelayedCount "unrelayed-packets" "src" 1
4445
expectUnrelayedCount "unrelayed-packets" "dst" 1
4546
expectUnrelayedCount "unrelayed-acknowledgements" "src" 0
4647
expectUnrelayedCount "unrelayed-acknowledgements" "dst" 0
4748

49+
sleep 30
50+
date; echo " yyyyyyyy Now is @36. At @30, packets can be relayed and they will be processed in next relayer srv loop at @40"
4851

49-
sleep 43
50-
echo " yyyyyyyy Now is 46s. At 30s+, src->dst and dst->src relays are started and it takes 20s for waiting SHFU on dst and joining. Expect src=(1,0), dst=(1,0)"
52+
sleep 7
53+
date; echo " yyyyyyyy Now is @43. At @40, relayer runs srv loop and process packets. Note that dst->src relay takes SHFU_WAIT time(20s)"
5154
expectUnrelayedCount "unrelayed-packets" "src" 1
5255
expectUnrelayedCount "unrelayed-packets" "dst" 1
5356
expectUnrelayedCount "unrelayed-acknowledgements" "src" 0
5457
expectUnrelayedCount "unrelayed-acknowledgements" "dst" 0
5558

56-
sleep 13
57-
echo " yyyyyyyy Now is 59s. At 50s+ src->dst and dst->src relays are completed. Expect src=(0,1), dst=(0,1)"
59+
sleep 27
60+
date; echo " yyyyyyyy Now is @70. At @60, dst->src wait is end and both packets are sent. Sending will take about 3s for confirmation on each chain. Then relayer sleep until next interval at @86"
5861
expectUnrelayedCount "unrelayed-packets" "src" 0
5962
expectUnrelayedCount "unrelayed-packets" "dst" 0
6063
expectUnrelayedCount "unrelayed-acknowledgements" "src" 1
6164
expectUnrelayedCount "unrelayed-acknowledgements" "dst" 1
6265

6366
sleep 30
64-
echo " yyyyyyyy Now is 89s. At 80s+ dst->src and src->dst ack relays are started and not yet completed. Expect src=(0,1), dst=(0,1)"
67+
date; echo " yyyyyyyy Now is @100. At @96, ack packets spend optimize-interval(30s) and they can be on target list"
68+
69+
sleep 10
70+
date; echo " yyyyyyyy Now is @110. At @106, relayer runs srv loop and process packets. Note that dst->src relay takes SHFU_WAIT time(20s)"
6571
expectUnrelayedCount "unrelayed-packets" "src" 0
6672
expectUnrelayedCount "unrelayed-packets" "dst" 0
6773
expectUnrelayedCount "unrelayed-acknowledgements" "src" 1
6874
expectUnrelayedCount "unrelayed-acknowledgements" "dst" 1
6975

70-
sleep 23
71-
echo " yyyyyyyy Now is 112s. At 100s+ dst->src and dst->src ack relays are completed. Expect src=(0,0), dst=(0,0)"
76+
sleep 30
77+
date; echo " yyyyyyyy Now is @140. At @126, dst->src wait is end and both packets are sent. Being confirmed at @132."
7278
expectUnrelayedCount "unrelayed-packets" "src" 0
7379
expectUnrelayedCount "unrelayed-packets" "dst" 0
7480
expectUnrelayedCount "unrelayed-acknowledgements" "src" 0

tests/cases/tm2tm/scripts/test-tx-fakelost

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
set -eux
44

5+
SEQID=1
6+
if [ ! -z "$1" ]; then
7+
SEQID=$1
8+
fi
9+
510
SCRIPT_DIR=$(cd $(dirname $0); pwd)
611
RLY_BINARY=${SCRIPT_DIR}/../../../../build/yrly
712
RLY="${RLY_BINARY} --debug"
@@ -22,6 +27,6 @@ export DEBUG_RELAYER_SHFU_WAIT_ibc1="20"
2227
docker exec tendermint-chain0 sh -c "simd --home /root/data/ibc0 tx --keyring-backend=test --from ${TM_ADDRESS0} --chain-id ibc0 mockapp send mockapp channel-0 'mock packet data' --yes"
2328
docker exec tendermint-chain1 sh -c "simd --home /root/data/ibc1 tx --keyring-backend=test --from ${TM_ADDRESS1} --chain-id ibc1 mockapp send mockapp channel-0 'mock packet data' --yes"
2429
sleep ${TX_INTERNAL}
25-
${RLY} tx relay --do-refresh ibc01 --src-seqs 1 --dst-seqs 1
30+
${RLY} tx relay --do-refresh ibc01 --src-seqs $SEQID --dst-seqs $SEQID
2631
sleep ${TX_INTERNAL}
27-
${RLY} tx acks --do-refresh ibc01 --src-seqs 1 --dst-seqs 1
32+
${RLY} tx acks --do-refresh ibc01 --src-seqs $SEQID --dst-seqs $SEQID

0 commit comments

Comments
 (0)