Must run tests with threads=0 option