Skip to content

Commit 95c9708

Browse files
committed
[Test] AD integration test: logging more information around non deterministically failing removal of AD user home directory.
Signed-off-by: Giacomo Marciani <[email protected]>
1 parent 30adbc5 commit 95c9708

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tests/integration-tests/tests/ad_integration/cluster_user.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,21 @@ def assert_job_succeeded(self, job_id):
9696
"""Wrapper around SchedulerCommand's assert_job_succeded method."""
9797
self._personalized_scheduler_commands.assert_job_succeeded(job_id)
9898

99+
def list_home(self):
100+
"""List home directory for this user"""
101+
logging.info("Listing home directory for user %s (%s)", self.alias, self.home_dir)
102+
self._default_user_remote_command_executor.run_remote_command(f"sudo ls -lart {self.home_dir}", log_output=True)
103+
99104
def cleanup(self):
100105
"""Cleanup resources associated with this user."""
106+
self.list_home()
101107
logging.info("Removing home directory for user %s (%s)", self.alias, self.home_dir)
102-
self._default_user_remote_command_executor.run_remote_command(f"sudo rm -rf {self.home_dir}")
108+
try:
109+
self._default_user_remote_command_executor.run_remote_command(f"sudo rm -rfv {self.home_dir}")
110+
except Exception as e:
111+
logging.error("Cannot remove home directory for user %s (%s): %s", self.alias, self.home_dir, e)
112+
self.list_home()
113+
raise e
103114

104115
def ssh_connect(self, port=22, pkey=None):
105116
"""Establish a SSH connection to the cluster head node with the current user."""

0 commit comments

Comments
 (0)