Skip to content

Commit

Permalink
Use start-multi command in e2e test suite (#900)
Browse files Browse the repository at this point in the history
* Use start-multi command in e2e test suite

* Fix start-multi command invocation

* More sleep

* Fix Popen invocation
  • Loading branch information
romac authored May 7, 2021
1 parent 2a3aca3 commit e5d0e65
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
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)
9 changes: 5 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 @@ -81,9 +81,10 @@ def loop(c: Config):

sleep(5.0)

# 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)
# 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

0 comments on commit e5d0e65

Please sign in to comment.