unit-testing parallel code

20 views
Skip to first unread message

Reimundo Heluani

unread,
Jul 25, 2020, 8:46:17 AM7/25/20
to sage-...@googlegroups.com
Hello, I'm implementing a worker pool using Python's multiprocessing module.
My tests run fine under the Sage interactive interpreter or the Jupyter
notebook, but they fail with a MemoryError as if I have ran out of available
threads when running the unit tests with "sage -t"

RuntimeError: can't start new thread

I suppose this is because "sage -t" open new processes before running the
tests. Where in the code should I start looking to debug this, I'd like to
implement this in a way that the actual tests are run by "sage -t". I mean I
could bypass this problem by checking if the current process is the main
process before forking the worker pool, but the problem of this approach is
that the environment would be different on a run of "sage -t" and on a run
in the interactive interpreter, so I would lose the functionality of the
docstring tests.

Best,

R.
signature.asc
Reply all
Reply to author
Forward
0 new messages