commands: refactor to avoid using no_wait arg.

In the, the RunHWTestSuite method will call run_suite script twice,
one with create_and_return arg to create a suite job and exit, and the other
call with 'mock_job_id' arg to wait for the suite results. However, when we
specify --no_wait is True, the second call does not wait for results,
thus become unnecessary. So, refactor to call run_suite
script twice only when we explicitly specify to wait for results, and
omit the --no-wait arg.

TEST=unittest and tryjob test with expected results.
cbuidlbot --remote -g "302135 302100" --hwtest lumpy-release.

Change-Id: Ic1eff91a14389af9219248e24ff25852d6804c80
(cherry picked from commit 5262ce9aeb073ea5a7edfda21fe1479f33c278ad)
Reviewed-by: Fang Deng <>
Commit-Queue: Shuqian Zhao <>
Tested-by: Shuqian Zhao <>
2 files changed