google / google/openhtf

KillableThread cannot be killed when in time.sleep

Open
#802 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
722
Forks
237
Avg merge
11h 31m
Merged PRs (30d)
4

Description

```python
import time
import threading

def unkillable_phase(test):
print('hello start')
time.sleep(1)
print('hello middle')
time.sleep(2)
print('hello end')

def alternate_killable_phase(test):
print('hello start')
threading.Event().wait(1)
print('hello middle')
threading.Event().wait(2)
print('hello end')
```

The first phase cannot be killed with CTRL-C, but the second one can be.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.