Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use start-multi command in e2e test suite #900

Merged
merged 6 commits into from
May 7, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions e2e/e2e/relayer.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@

from subprocess import Popen
import logging as l
from typing import Optional

from .cmd import Config
from .common import ChainId, PortId, ChannelId


def start(c: Config, src: ChainId, dst: ChainId, src_port: Optional[PortId], src_channel: Optional[ChannelId]) -> Popen:
args = [str(src), str(dst)]
if src_port != None:
args.extend(['-p', str(src_port)])
if src_channel != None:
args.extend(['-c', str(src_channel)])

full_cmd = f'{c.relayer_cmd} -c {c.config_file} --json start'.split(' ')
full_cmd.extend(args)

def start(c: Config) -> Popen:
full_cmd = f'{c.relayer_cmd} -c {c.config_file} -j start-multi'.split(' ')
l.debug(' '.join(full_cmd))

return Popen(full_cmd)
11 changes: 7 additions & 4 deletions e2e/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def loop(c: Config):
packet.packet_send(c, src=IBC_0, dst=IBC_1, src_port=TRANSFER,
src_channel=IBC_0_CHANNEL, amount=10000, height_offset=1000, number_msgs=4)

sleep(5.0)
sleep(10.0)

# 3. verify the expected number of unreceived packets and acks on each channel end

Expand Down Expand Up @@ -79,9 +79,12 @@ def loop(c: Config):

assert (len(unreceived) == 2), (unreceived, "unreceived packet mismatch")

# 4. start relaying on the channel - it should clear the unreceived packets
proc = relayer.start(c, src=IBC_0, dst=IBC_1,
src_port=TRANSFER, src_channel=IBC_0_CHANNEL)
sleep(2.0)

# 4. start relaying - it should clear the unreceived packets
proc = relayer.start(c)

sleep(5.0)

# 5. wait a bit and make sure there are no pending packets

Expand Down