tiny-pilot / tinypilot

Use your Raspberry Pi as a browser-based KVM.
https://tinypilotkvm.com
MIT License
2.99k stars 250 forks source link

`execute_test.py` producing error output during tests #1642

Closed jotaen4tinypilot closed 8 months ago

jotaen4tinypilot commented 11 months ago

In execute_test.py, there are two test cases which are producing error output while running, without making the tests fail, though:

Both tests are concerned with handling exceptions from the child process.

This might not be an actual bug, due to this note, but I’m not sure about it. If it isn’t a bug, we could maybe check whether we are able to reliably suppress the stack trace printing during the tests.

This is happening on the master branch, but I can also reproduce it locally. The logs snippet below is from the master branch, see here for the full build.

+ coverage run --source app --omit '*_test.py' --module unittest discover --pattern '*_test.py' app.log
.........................Exception in thread Thread-1:
.Traceback (most recent call last):
  File "/home/circleci/.pyenv/versions/3.9.17/lib/python3.9/threading.py", line 980, in _bootstrap_inner
.    self.run()
  File "/home/circleci/.pyenv/versions/3.9.17/lib/python3.9/threading.py", line 917, in run
    self._target(*self._args, **self._kwargs)
  File "/home/circleci/project/app/execute_test.py", line 31, in raise_exception
    raise Exception('Child exception')
Exception: Child exception
.Process ProcessWithResult-2:
Traceback (most recent call last):
  File "/home/circleci/.pyenv/versions/3.9.17/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/home/circleci/project/app/execute.py", line 37, in run
    result.return_value = self._target(*self._args, **self._kwargs)
  File "/home/circleci/project/app/execute_test.py", line 31, in raise_exception
    raise Exception('Child exception')
Exception: Child exception
...........................................................................................................................................................
----------------------------------------------------------------------
Ran 183 tests in 0.802s
mtlynch commented 11 months ago

Yeah, it's intentional, but we should look into cleaning it up because it does make the output confusing.