Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testThreadTaskWaitWhenNotStarted failure #110

Open
thiell opened this issue Mar 3, 2012 · 1 comment · Fixed by #474 · May be fixed by #480
Open

testThreadTaskWaitWhenNotStarted failure #110

thiell opened this issue Mar 3, 2012 · 1 comment · Fixed by #474 · May be fixed by #480
Assignees
Labels
Milestone

Comments

@thiell
Copy link
Collaborator

thiell commented Mar 3, 2012

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 thiell modified the milestones: 1.7, 2.0 Mar 22, 2015
@thiell thiell modified the milestones: 1.8, 1.7 Oct 29, 2015
@thiell thiell modified the milestones: 1.8, 1.9 Sep 17, 2017
thiell added a commit to thiell/clustershell that referenced this issue Jun 26, 2022
@thiell thiell self-assigned this Jun 26, 2022
@thiell
Copy link
Collaborator Author

thiell commented Jun 28, 2022

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 thiell reopened this Jun 28, 2022
thiell added a commit to thiell/clustershell that referenced this issue Jul 4, 2022
Add a check using existing _terminated attribute to avoid terminating
a Task multiple times, which could cause issues.

Closes cea-hpc#110
@thiell thiell linked a pull request Jul 4, 2022 that will close this issue
@thiell thiell modified the milestones: 1.9, 1.10 Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant