Skip to content

Commit

Permalink
Fix service interval
Browse files Browse the repository at this point in the history
Signed-off-by: Dongri Jin <[email protected]>
  • Loading branch information
dongrie committed Dec 7, 2023
1 parent 60eb531 commit 5dc1f2c
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 41 deletions.
34 changes: 17 additions & 17 deletions tests/cases/tm2tm/scripts/test-service
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#!/bin/bash

: <<'END_COMMENT'
* relay-interval = 10s
* src-relay-optimize-interval = 15s
* relay-interval = 20s
* src-relay-optimize-interval = 25s
* src-relay-optimize-count = 3
* dst-relay-optimize-interval = 15s
* dst-relay-optimize-interval = 25s
* dst-relay-optimize-count = 3
- relay service [packets = 0, time = 0] -> skip
- sleep 2
-
- transfer x 1
- packets = 1, ack = 0
- sleep 5
- sleep 15
-
-
-
Expand All @@ -22,13 +22,13 @@
-
- transfer x 1
- packets = 2, ack = 0
- sleep 5
- sleep 18
-
-
-
-
- relay service [packets = 2, time = 10] -> skip
- sleep 10
- relay service [packets = 2, time = 20] -> skip
- sleep 20
-
-
-
Expand All @@ -43,21 +43,21 @@
- packets = 0, ack = 2
- transfer x 3
- packets = 3, ack = 2
- sleep 5
- sleep 15
-
-
-
- relay service [packets = 3, time = 10] -> exec (count)
- relay service [packets = 3, time = 20] -> exec (count)
- sleep 2
-
- packets = 0, ack = 5
- sleep 8
- sleep 18
-
-
-
-
-
- relay service [packets = 0, time = 20] -> exec (ack) (time + count)
- relay service [packets = 0, time = 40] -> exec (ack) (time + count)
- sleep 2
-
- packets = 0, ack = 0
Expand All @@ -75,7 +75,7 @@ source ${SCRIPT_DIR}/utils
TM_ADDRESS0=$(${RLY} tendermint keys show ibc0 testkey)
TM_ADDRESS1=$(${RLY} tendermint keys show ibc1 testkey)

${RLY} service start ibc01 --relay-interval 10s --src-relay-optimize-interval 15s --src-relay-optimize-count 3 --dst-relay-optimize-interval 15s --dst-relay-optimize-count 3 &
${RLY} service start ibc01 --relay-interval 20s --src-relay-optimize-interval 25s --src-relay-optimize-count 3 --dst-relay-optimize-interval 25s --dst-relay-optimize-count 3 &
RLY_PID=$!
echo "xxxxxxx relay service [packets = 0, time = 0] -> skip xxxxxx"
sleep 2
Expand All @@ -85,7 +85,7 @@ ${RLY} tx transfer ibc01 ibc0 ibc1 100samoleans ${TM_ADDRESS1}

expectUnrelayedCount "unrelayed-packets" "src" 1
expectUnrelayedCount "unrelayed-acknowledgements" "dst" 0
sleep 5
sleep 15

echo "xxxxxxx relay service [packets = 1, time = 0] -> skip xxxxxx"
sleep 2
Expand All @@ -94,10 +94,10 @@ ${RLY} tx transfer ibc01 ibc0 ibc1 100samoleans ${TM_ADDRESS1}

expectUnrelayedCount "unrelayed-packets" "src" 2
expectUnrelayedCount "unrelayed-acknowledgements" "dst" 0
sleep 5
sleep 18

echo "xxxxxxx relay service [packets = 2, time = 10] -> skip xxxxxx"
sleep 10
sleep 20

echo "xxxxxxx relay service [packets = 2, time = 20] -> exec (time) xxxxxx"
sleep 2
Expand All @@ -111,14 +111,14 @@ ${RLY} tx transfer ibc01 ibc0 ibc1 100samoleans ${TM_ADDRESS1}

expectUnrelayedCount "unrelayed-packets" "src" 3
expectUnrelayedCount "unrelayed-acknowledgements" "dst" 2
sleep 5
sleep 14

echo "xxxxxxx relay service [packets = 3, time = 10] -> exec (count) xxxxxx"
sleep 2

expectUnrelayedCount "unrelayed-packets" "src" 0
expectUnrelayedCount "unrelayed-acknowledgements" "dst" 5
sleep 8
sleep 18

echo "xxxxxxx relay service [packets = 0, time = 20] -> exec (ack) (time + count) xxxxxx"
sleep 2
Expand Down
49 changes: 25 additions & 24 deletions tests/cases/tmmock2tmmock/scripts/test-service
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash

: <<'END_COMMENT'
* relay-interval = 10s
* src-relay-optimize-interval = 15s
* relay-interval = 20s
* src-relay-optimize-interval = 25s
* src-relay-optimize-count = 3
* dst-relay-optimize-interval = 15s
* dst-relay-optimize-interval = 25s
* dst-relay-optimize-count = 3
- relay service [query = 0, time = 0] -> skip
Expand All @@ -15,7 +15,7 @@
-
- finality
- packets = 1, ack = 0
- sleep 3
- sleep 12
-
- relay service [query = 1, time = 0] -> skip
- sleep 2
Expand All @@ -25,10 +25,10 @@
-
- finality
- packets = 2, ack = 0
- sleep 5
- sleep 15
-
- relay service [query = 2, time = 10] -> skip
- sleep 10
- relay service [query = 2, time = 20] -> skip
- sleep 20
-
-
-
Expand All @@ -37,7 +37,7 @@
-
-
-
- relay service [query = 2, time = 20] -> exec (time)
- relay service [query = 2, time = 40] -> exec (time)
- sleep 2
-
- packets = 0, ack = 2
Expand All @@ -46,18 +46,18 @@
-
- finality
- packets = 3, ack = 2
- sleep 5
- relay service [query = 3, time = 10] -> exec (count)
- sleep 12
- relay service [query = 3, time = 20] -> exec (count)
- sleep 2
-
- packets = 0, ack = 5
- sleep 8
- sleep 18
-
-
-
-
-
- relay service [packets = 0, time = 20] -> exec (ack) (time + count)
- relay service [packets = 0, time = 40] -> exec (ack) (time + count)
- sleep 2
-
- packets = 0, ack = 0
Expand All @@ -75,32 +75,33 @@ source ${SCRIPT_DIR}/utils
TM_ADDRESS0=$(${RLY} tendermint keys show ibc0 testkey)
TM_ADDRESS1=$(${RLY} tendermint keys show ibc1 testkey)

${RLY} service start ibc01 --relay-interval 10s --src-relay-optimize-interval 15s --src-relay-optimize-count 3 --dst-relay-optimize-interval 15s --dst-relay-optimize-count 3 &
SECONDS=0
${RLY} service start ibc01 --relay-interval 20s --src-relay-optimize-interval 25s --src-relay-optimize-count 3 --dst-relay-optimize-interval 25s --dst-relay-optimize-count 3 &
RLY_PID=$!
echo "xxxxxxx relay service [query = 0, time = 0] -> skip xxxxxx"
echo "xxxxxxx ${SECONDS} relay service [query = 0, time = 0] -> skip xxxxxx"
sleep 2

${RLY} tx transfer ibc01 ibc0 ibc1 100samoleans ${TM_ADDRESS1}
sleep 3 # finality_delay

expectUnrelayedCount "unrelayed-packets" "src" 1
expectUnrelayedCount "unrelayed-acknowledgements" "dst" 0
sleep 3
sleep 12

echo "xxxxxxx relay service [query = 1, time = 0] -> skip xxxxxx"
echo "xxxxxxx ${SECONDS} relay service [query = 1, time = 0] -> skip xxxxxx"
sleep 2

${RLY} tx transfer ibc01 ibc0 ibc1 100samoleans ${TM_ADDRESS1}
sleep 3 # finality_delay

expectUnrelayedCount "unrelayed-packets" "src" 2
expectUnrelayedCount "unrelayed-acknowledgements" "dst" 0
sleep 5
sleep 15

echo "xxxxxxx relay service [query = 2, time = 10] -> skip xxxxxx"
sleep 10
echo "xxxxxxx ${SECONDS} relay service [query = 2, time = 10] -> skip xxxxxx"
sleep 20

echo "xxxxxxx relay service [query = 2, time = 20] -> exec (time) xxxxxx"
echo "xxxxxxx ${SECONDS} relay service [query = 2, time = 20] -> exec (time) xxxxxx"
sleep 2

expectUnrelayedCount "unrelayed-packets" "src" 0
Expand All @@ -114,16 +115,16 @@ sleep 3 # finality_delay

expectUnrelayedCount "unrelayed-packets" "src" 3
expectUnrelayedCount "unrelayed-acknowledgements" "dst" 2
sleep 5
sleep 12

echo "xxxxxxx relay service [query = 3, time = 10] -> exec (count) xxxxxx"
echo "xxxxxxx ${SECONDS} relay service [query = 3, time = 10] -> exec (count) xxxxxx"
sleep 2

expectUnrelayedCount "unrelayed-packets" "src" 0
expectUnrelayedCount "unrelayed-acknowledgements" "dst" 5
sleep 8
sleep 18

echo "xxxxxxx relay service -> exec (ack) - time + count xxxxxx"
echo "xxxxxxx ${SECONDS} relay service -> exec (ack) - time + count xxxxxx"
sleep 2

expectUnrelayedCount "unrelayed-packets" "src" 0
Expand Down

0 comments on commit 5dc1f2c

Please sign in to comment.