I’m having a very odd issue with PlatformIO’s unit testing using the VSCode extension for PlatformIO. I am trying to run unit testing on an ESP32. Whenever I try to use pio test
to run any unit tests, it with freeze when waiting for output:
C:\Git\esp32-project>pio test -f test_test
Verbose mode can be enabled via `-v, --verbose` option
Collected 9 items
Processing test_test in esp32dev environment
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Building...
Uploading...
Testing...
If you don't see any output for the first 10 secs, please reset board (press reset button)
At this point I am unable to cancel the testing using Ctrl+C. The only way to kill it is to close the PlatformIO CLI terminal altogether.
Things I have tried:
- Wait 10 seconds: Problem persists
- Power cycle the ESP32: Problem persists
- Add a delay of 10 seconds before starting the tests: Problem persists
- Change the
monitor_speed
from 115200 to 9600: Problem persists - Upload the test, then connect via the Serial Monitor: I see the output I would expect (although it isn’t colored). This is not a solution because I can’t run a series of tests in an automated fashion.
- Update PlatformIO to the dev build: Problem persists
- Uninstalling and reinstalling PlatformIO: Problem persists
Other observations
- This problem only exists on some of the ESP32 boards I have. I have at least one ESP32 board that can run unit tests just fine. However, it doesn’t work on the board I need it to work on.
- On the problematic boards, the problem persists across multiple PlatformIO projects with different
platformio.ini
files. - I’ve had two other people try to run the same unit tests on the problematic boards, and the unit tests DID work for them.
That last point is the most confusing for me. Why would it work on someone else’s computer but not mine? Does anyone have any ideas how I could remedy this issue?