Powercycle should check for existence of a process before accessing it's attributes

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.1.2
    • Affects Version/s: None
    • Component/s: Testing Infrastructure
    • None
    • Fully Compatible
    • ALL
    • v4.0, v3.6
    • TIG 2018-08-27
    • 46
    • 1
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      It's possible then when iterating over a list of processes that the process could finish before it's accessed:

              for proc in psutil.process_iter():
                  if proc.name() == self.name:
                      self.pids.append(proc.pid)
      

      An additional check should be added

      if psutil.pid_exists(proc.pid) and proc.name() == self.name
      

              Assignee:
              Jonathan Abrahams (Inactive)
              Reporter:
              Jonathan Abrahams (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: