Skip to content

Commit

Permalink
Wait for service start when setting up test VMs; collect VM logs when…
Browse files Browse the repository at this point in the history
… setup fails (#2830)

Co-authored-by: narrieta <narrieta>
  • Loading branch information
narrieta committed Jun 5, 2023
1 parent ded1f10 commit 82d486f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
6 changes: 5 additions & 1 deletion tests_e2e/orchestrator/lib/agent_test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,11 @@ def _execute(self, environment: Environment, variables: Dict[str, Any]):
# its type is List[AgentTestSuite].
# E1133: Non-iterable value self.context.test_suites is used in an iterating context (not-an-iterable)
install_test_agent = all([suite.install_test_agent for suite in self.context.test_suites]) # pylint: disable=E1133
self._setup_node(install_test_agent)
try:
self._setup_node(install_test_agent)
except:
test_suite_success = False
raise

for suite in self.context.test_suites: # pylint: disable=E1133
log.info("Executing test suite %s", suite.name)
Expand Down
17 changes: 16 additions & 1 deletion tests_e2e/orchestrator/scripts/install-agent
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,22 @@ echo "Agent Path: $waagent"
echo "Agent Version:"
$python "$waagent" --version
echo "Service Status:"
service-status $service_name

# Sometimes the service can take a while to start; give it a few minutes,
started=false
for i in {1..6}
do
if service-status $service_name; then
started=true
break
fi
echo "Waiting for service to start..."
sleep 30
done
if [ $started == false ]; then
echo "Service failed to start."
exit 1
fi

#
# Install the package
Expand Down

0 comments on commit 82d486f

Please sign in to comment.