kopf icon indicating copy to clipboard operation
kopf copied to clipboard

`kopf.testing.KopfRunner` wedges on operator startup failures

Open brianthelion opened this issue 3 years ago • 0 comments

Long story short

Simple typos and ImportErrors in the operator namespace cause kopf.testing.KopfRunner to hang forever. This is a problem for CI/CD workflows.

Kopf version

1.35.2

Kubernetes version

1.22

Python version

3.8

Code

This works as expected:

$ kopf run -m does.not.exist -A --debug
[2021-11-18 16:51:41,213] asyncio              [DEBUG   ] Using selector: EpollSelector
Traceback (most recent call last):
...
ModuleNotFoundError: No module named 'does'

This hangs forever

import kopf.testing
import shlex
kopf.testing.KopfRunner(shlex.split("run -m does.not.exist -A --debug")).exit_code

Logs

See above.

Additional information

No response

brianthelion avatar Nov 18 '21 16:11 brianthelion