Skip to content

Commit

Permalink
Remove reduntant log assertion from simple service test (#570)
Browse files Browse the repository at this point in the history
  • Loading branch information
kmazurek authored Aug 4, 2021
1 parent ca29e0f commit 5778150
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tests/goth_tests/test_run_simple_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

logger = logging.getLogger("goth.test.run_simple_service")

RUNNING_TIME = 40 # in seconds
SUBNET_TAG = "goth"


@pytest.mark.asyncio
async def test_run_simple_service(
Expand All @@ -43,7 +46,7 @@ async def test_run_simple_service(
requestor = runner.get_probes(probe_type=RequestorProbe)[0]

async with requestor.run_command_on_host(
f"{requestor_path} --running-time 40 --subnet-tag goth",
f"{requestor_path} --running-time {RUNNING_TIME} --subnet-tag {SUBNET_TAG}",
env=os.environ,
) as (_cmd_task, cmd_monitor):

Expand All @@ -52,14 +55,10 @@ async def test_run_simple_service(
def elapsed_time():
return f"time: {(time.time() - start_time):.1f}"

# Add assertions to the command output monitor `cmd_monitor`:
cmd_monitor.add_assertion(assert_no_errors)
cmd_monitor.add_assertion(assert_all_invoices_accepted)

await cmd_monitor.wait_for_pattern("Starting 1 instance", timeout=20)
await cmd_monitor.wait_for_pattern("instances:.*starting", timeout=20)
logger.info(f"The instance is starting ({elapsed_time()})")

# A longer timeout to account for downloading a VM image
await cmd_monitor.wait_for_pattern("All instances started", timeout=120)
logger.info(f"The instance was started successfully ({elapsed_time()})")
Expand All @@ -72,4 +71,4 @@ def elapsed_time():
logger.info(f"The instance is stopping ({elapsed_time()})")

await cmd_monitor.wait_for_pattern(".*All jobs have finished", timeout=20)
logger.info(f"Requestor script finished ({elapsed_time()}")
logger.info(f"Requestor script finished ({elapsed_time()})")

0 comments on commit 5778150

Please sign in to comment.