-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add option to launch each test in separate process #238
Conversation
d255b31
to
1c67297
Compare
This works in all the cases I tried on Linux. |
1c67297
to
cb80e36
Compare
Potentially blocked on robotpy/mostrobotpy#146 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried this on my team's robot code today. Unit tests run fine, but the pyfrc tests mysteriously fail with no further information.
❱ .venv/bin/robotpy test --isolated -- --maxfail=0
12:22:55:462 INFO : faulthandler : registered SIGUSR2 for PID 153549
[phoenix] CANbus Connected: sim
[phoenix] CANbus Network Up: sim
============================= test session starts ==============================
platform linux -- Python 3.13.1, pytest-8.3.3, pluggy-1.5.0 -- /home/davo/dev/frc/thedropbears/pyreefscape/.venv/bin/python
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase(PosixPath('/home/davo/dev/frc/thedropbears/pyreefscape/.hypothesis/examples'))
rootdir: /home/davo/dev/frc/thedropbears/pyreefscape
configfile: pyproject.toml
testpaths: tests
plugins: integration-0.2.3, reraise-2.1.2, hypothesis-6.119.3, typeguard-4.3.0
collected 25 items
tests/pyfrc_test.py::test_disabled FAILED [ 4%]
tests/pyfrc_test.py::test_operator_control FAILED [ 8%]
tests/test_caching.py::test_cache_per_loop PASSED [ 12%]
tests/test_constrain_angle.py::test_happy PASSED [ 16%]
tests/test_constrain_angle.py::test_all PASSED [ 20%]
tests/test_constrain_angle.py::test_zero PASSED [ 24%]
tests/test_constrain_angle.py::test_edge_pos PASSED [ 28%]
tests/test_constrain_angle.py::test_edge_neg PASSED [ 32%]
tests/test_constrain_angle.py::test_revolution_pos PASSED [ 36%]
tests/test_constrain_angle.py::test_revolution_neg PASSED [ 40%]
tests/test_constrain_angle.py::test_one_wrap_positive_half PASSED [ 44%]
tests/test_constrain_angle.py::test_one_wrap_negative_half PASSED [ 48%]
tests/test_functions.py::test_rate_limit2d PASSED [ 52%]
tests/test_functions.py::test_rate_limit_2d_limit PASSED [ 56%]
tests/test_functions.py::test_clamp2d_noconstrain PASSED [ 60%]
tests/test_functions.py::test_clamp2d_constrain PASSED [ 64%]
tests/test_scalers.py::test_deadzone PASSED [ 68%]
tests/test_scalers.py::test_deadzone_zero_threshold PASSED [ 72%]
tests/test_scalers.py::test_exponential PASSED [ 76%]
tests/test_scalers.py::test_scale_value PASSED [ 80%]
tests/fuzz_test.py::test_fuzz[Blue2] SKIPPED (Integration tests skipped) [ 84%]
tests/fuzz_test.py::test_fuzz[Red1] SKIPPED (Integration tests skipped) [ 88%]
tests/fuzz_test.py::test_fuzz_test SKIPPED (Integration tests skipped) [ 92%]
tests/autonomous_test.py::test_all_autonomous[Red] SKIPPED (Slow int...) [ 96%]
tests/autonomous_test.py::test_all_autonomous[Blue] SKIPPED (Slow in...) [100%]
=================================== FAILURES ===================================
________________________________ test_disabled _________________________________
Test failed in subprocess: tests/pyfrc_test.py::test_disabled
----------------------------- Captured stdout call -----------------------------
[phoenix] CANbus Connected: sim
[phoenix] CANbus Network Up: sim
============================= test session starts ==============================
collecting ... collected 1 item
tests/pyfrc_test.py::test_disabled FAILED [100%]
============================== 1 failed in 0.12s ===============================
----------------------------- Captured stderr call -----------------------------
12:22:56:843 INFO : pyfrc.physics : Physics support successfully enabled
[phoenix-diagnostics] Server shutdown cleanly. (dur:0)
[phoenix] Library shutdown cleanly
____________________________ test_operator_control _____________________________
Test failed in subprocess: tests/pyfrc_test.py::test_operator_control
----------------------------- Captured stdout call -----------------------------
[phoenix] CANbus Connected: sim
[phoenix] CANbus Network Up: sim
============================= test session starts ==============================
collecting ... collected 1 item
tests/pyfrc_test.py::test_operator_control FAILED [100%]
============================== 1 failed in 0.14s ===============================
----------------------------- Captured stderr call -----------------------------
12:22:58:254 INFO : pyfrc.physics : Physics support successfully enabled
[phoenix] Library initialization is complete.
[phoenix-diagnostics] Server shutdown cleanly. (dur:0)
[phoenix] Library shutdown cleanly
=========================== short test summary info ============================
FAILED tests/pyfrc_test.py::test_disabled - Failed: Test failed in subprocess: tests/pyfrc_test.py::test_disabled
FAILED tests/pyfrc_test.py::test_operator_control - Failed: Test failed in subprocess: tests/pyfrc_test.py::test_operator_control
=================== 2 failed, 18 passed, 5 skipped in 29.43s ===================
[phoenix-diagnostics] Server shutdown cleanly. (dur:0)
[phoenix] Library shutdown cleanly
The |
2212aeb
to
34bcb1b
Compare
Got the failure details now:
|
4581ed3
to
9c7267a
Compare
Either specify directly on command line, or add tool.robotpy.pyfrc.multiprocess to pyproject.toml. If it works out, expect to make this default in 2026
e313b17
to
e4046c9
Compare
Either specify directly on command line, or add this to pyproject.toml:
If it works out, expect to make this default in 2026. Replaces #236
Currently, this almost works, but I haven't tried it on Windows yet.
examples/Timed
project worksexamples/Physics
project does not work yet (any project that has a embedded 'tests' directory). Need to get rid of directory changing as auscompgeek suggested.robotpy tests --builtin