Skip to content

Conversation

@squirrelsc
Copy link
Member

Currently, timeouts in PowerShell tools are not handled properly. An exception is raised with an empty error message. So, the underlying process should always raise exeptions to get errors obvious. To compatible with some rare condition, make it configurable.

Currently, timeouts in PowerShell tools are not handled properly. An exception is raised with an empty error message. So, the underlying process should always raise exeptions to get errors obvious. To compatible with some rare condition, make it configurable.
@squirrelsc squirrelsc requested a review from LiliDeng as a code owner October 27, 2025 22:16
@squirrelsc
Copy link
Member Author

@vyadavmsft Please check this fix, it should raise exception on timeout. It can solve the problem of #4066.

@LiliDeng
Copy link
Collaborator

While testing your PR, I came across an existing bug that was already present in the code.

2025-10-28 06:01:17.033[1796][DEBUG] lisa.local.cmd[2852] cmd: ['cmd', '/c', 'hostname'], cwd: None, shell: True, sudo: False, nohup: False, posix: False, remote: False, encoding: utf-8
2025-10-28 06:01:17.038[7952][ERROR] lisa.env[generated_6] case failed
Traceback (most recent call last):
  File "C:\app\lsg-lisa\lisa\lisa\runners\lisa_runner.py", line 297, in _deploy_environment_task
    self.platform.deploy_environment(environment)
  File "C:\app\lsg-lisa\lisa\lisa\platform_.py", line 188, in deploy_environment
    raise identifier
  File "C:\app\lsg-lisa\lisa\lisa\platform_.py", line 185, in deploy_environment
    self._deploy_environment(environment, log)
  File "C:\app\lsg-lisa\lisa\lisa\sut_orchestrator\azure\platform_.py", line 662, in _deploy_environment
    raise e
  File "C:\app\lsg-lisa\lisa\lisa\sut_orchestrator\azure\platform_.py", line 633, in _deploy_environment
    location, deployment_parameters = self._create_deployment_parameters(
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\app\lsg-lisa\lisa\lisa\sut_orchestrator\azure\platform_.py", line 1231, in _create_deployment_parameters
    arm_parameters.vm_tags["lisa_username"] = local().tools[Whoami].get_username()
                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\app\lsg-lisa\lisa\lisa\tools\whoami.py", line 21, in get_username
    return self.run("", shell=True).stdout.strip()
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\app\lsg-lisa\lisa\lisa\executable.py", line 329, in run
    return process.wait_result(
           ^^^^^^^^^^^^^^^^^^^^
  File "C:\app\lsg-lisa\lisa\lisa\util\process.py", line 384, in wait_result
    assert self._process
           ^^^^^^^^^^^^^
AssertionError
2025-10-28 06:01:17.038[7952][INFO] lisa.runner[0] 'generated_6' attached to test case 'AzureImageStandard.verify_ifcfg_eth0(lisa_0_6)': 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants