Skip to content

Commit

Permalink
Fix service test
Browse files Browse the repository at this point in the history
Signed-off-by: Dongri Jin <[email protected]>
  • Loading branch information
dongrie committed Dec 20, 2023
1 parent 72f43b7 commit 2593214
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 77 deletions.
43 changes: 7 additions & 36 deletions tests/cases/tm2tm/scripts/test-service
Original file line number Diff line number Diff line change
Expand Up @@ -9,57 +9,28 @@
- relay service [packets = 0, time = 0] -> skip
- sleep 4
-
- transfer x 1
- packets = 1, ack = 0
- sleep 16
-
-
-
-
- relay service [packets = 1, time = 0] -> skip
- sleep 4
-
- transfer x 1
- packets = 2, ack = 0
- sleep 16
-
-
-
-
- relay service [packets = 2, time = 20] -> skip
- sleep 20
-
-
-
-
-
-
-
-
- relay service [packets = 2, time = 20] -> exec (time)
- relay service [packets = 2, time = 40] -> exec (time)
- sleep 4
-
- packets = 0, ack = 2
- transfer x 3
- packets = 3, ack = 2
- sleep 16
-
-
-
- relay service [packets = 3, time = 20] -> exec (count)
- relay service [packets = 3, time = 0] -> exec (count)
- sleep 4
-
- packets = 0, ack = 5
- sleep 16
-
-
-
-
-
- relay service [packets = 0, time = 40] -> exec (ack) (time + count)
- relay service [acks = 5, time = 40] -> exec (time + count)
- sleep 4
-
- packets = 0, ack = 0
- Finished
END_COMMENT
Expand Down Expand Up @@ -96,10 +67,10 @@ expectUnrelayedCount "unrelayed-packets" "src" 2
expectUnrelayedCount "unrelayed-acknowledgements" "dst" 0
sleep 16

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

echo "xxxxxxx relay service [packets = 2, time = 20] -> exec (time) xxxxxx"
echo "xxxxxxx relay service [packets = 2, time = 40] -> exec (time) xxxxxx"
sleep 4

expectUnrelayedCount "unrelayed-packets" "src" 0
Expand All @@ -113,14 +84,14 @@ expectUnrelayedCount "unrelayed-packets" "src" 3
expectUnrelayedCount "unrelayed-acknowledgements" "dst" 2
sleep 16

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

expectUnrelayedCount "unrelayed-packets" "src" 0
expectUnrelayedCount "unrelayed-acknowledgements" "dst" 5
sleep 16

echo "xxxxxxx relay service [packets = 0, time = 20] -> exec (ack) (time + count) xxxxxx"
echo "xxxxxxx relay service [acks = 5, time = 40] -> exec (time + count) xxxxxx"
sleep 4

expectUnrelayedCount "unrelayed-packets" "src" 0
Expand Down
56 changes: 15 additions & 41 deletions tests/cases/tmmock2tmmock/scripts/test-service
Original file line number Diff line number Diff line change
Expand Up @@ -7,59 +7,33 @@
* dst-relay-optimize-interval = 25s
* dst-relay-optimize-count = 3
- relay service [query = 0, time = 0] -> skip
- relay service [packets = 0, time = 0] -> skip
- sleep 4
-
- transfer x 1
-
-
- finality
- sleep 3 finality
- packets = 1, ack = 0
- sleep 13
-
- relay service [query = 1, time = 0] -> skip
- relay service [packets = 1, time = 0] -> skip
- sleep 4
-
- transfer x 1
-
-
- finality
- sleep 3 finality
- packets = 2, ack = 0
- sleep 13
-
- relay service [query = 2, time = 20] -> skip
- relay service [packets = 2, time = 20] -> skip
- sleep 20
-
-
-
-
-
-
-
-
- relay service [query = 2, time = 40] -> exec (time)
- relay service [packets = 2, time = 40] -> exec (time)
- sleep 4
-
- packets = 0, ack = 2
- transfer x 3
-
-
- finality
- sleep 3 finality
- packets = 3, ack = 2
- sleep 13
- relay service [query = 3, time = 20] -> exec (count)
- relay service [packets = 3, time = 0] -> exec (count)
- sleep 4
-
- packets = 0, ack = 5
- sleep 16
-
-
-
-
-
- relay service [packets = 0, time = 40] -> exec (ack) (time + count)
- relay service [acks = 5, time = 40] -> exec (time + count)
- sleep 4
-
- packets = 0, ack = 0
- Finished
END_COMMENT
Expand All @@ -78,7 +52,7 @@ TM_ADDRESS1=$(${RLY} tendermint keys show ibc1 testkey)
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 ${SECONDS} relay service [query = 0, time = 0] -> skip xxxxxx"
echo "xxxxxxx ${SECONDS} relay service [packets = 0, time = 0] -> skip xxxxxx"
sleep 4

${RLY} tx transfer ibc01 ibc0 ibc1 100samoleans ${TM_ADDRESS1}
Expand All @@ -88,7 +62,7 @@ expectUnrelayedCount "unrelayed-packets" "src" 1
expectUnrelayedCount "unrelayed-acknowledgements" "dst" 0
sleep 13

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

${RLY} tx transfer ibc01 ibc0 ibc1 100samoleans ${TM_ADDRESS1}
Expand All @@ -98,10 +72,10 @@ expectUnrelayedCount "unrelayed-packets" "src" 2
expectUnrelayedCount "unrelayed-acknowledgements" "dst" 0
sleep 13

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

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

expectUnrelayedCount "unrelayed-packets" "src" 0
Expand All @@ -117,14 +91,14 @@ expectUnrelayedCount "unrelayed-packets" "src" 3
expectUnrelayedCount "unrelayed-acknowledgements" "dst" 2
sleep 13

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

expectUnrelayedCount "unrelayed-packets" "src" 0
expectUnrelayedCount "unrelayed-acknowledgements" "dst" 5
sleep 16

echo "xxxxxxx ${SECONDS} relay service -> exec (ack) - time + count xxxxxx"
echo "xxxxxxx ${SECONDS} relay service [akcs = 5, time = 40] -> exec - time + count xxxxxx"
sleep 4

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

0 comments on commit 2593214

Please sign in to comment.