clustershell icon indicating copy to clipboard operation
clustershell copied to clipboard

testThreadTaskWaitWhenNotStarted failure

Open thiell opened this issue 12 years ago • 1 comments

Investigate and fix the following test. It's working but Python interpreter is hanging at the end (thread not joined?).

    def testThreadTaskWaitWhenNotStarted(self):
        """test task_wait() when workers not started"""

        for i in range(1, 5):
            task = Task()
            task.shell("sleep %d" % i)

        task_wait()
        task.resume()

thiell avatar Mar 03 '12 16:03 thiell

Reopening this as I've now noticed this backtrace:

test task_wait() when workers are running ... Exception in thread Task-981:
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/2.7.18/x64/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/opt/hostedtoolcache/Python/2.7.18/x64/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/runner/work/clustershell/clustershell/lib/ClusterShell/Task.py", line 390, in _thread_start
    self._terminate(kill=True)
  File "/home/runner/work/clustershell/clustershell/lib/ClusterShell/Task.py", line 960, in _terminate
    self._engine.clear(clear_ports=kill)
AttributeError: 'NoneType' object has no attribute 'clear'

Weirdly, it is not a fatal error for the test. I believe this is due to the next test added, which state is not properly cleared. I will investigate!

thiell avatar Jun 28 '22 19:06 thiell