Closed dougthor42 closed 8 years ago
Can you reproduce it when you run with just one process? (--processes 1
)
It looks like it doesn't happen with --processes 1
but I still haven't been able to reliably reproduce it, so it's hard to say if the issue does indeed get fixed.
It makes sense that running with multiple processes could be the issue. The tests that cause issues both act on external resources (file or SQLite database) which are created and deleted in the setUpClass
and tearDownClass
methods.
How does the multi-process option work? If a single TestCase class is always run on a single process, then I don't think it should cause an issue. But if the individual tests within a TestCase class are split to different processes, then I could definitely see why it causes a problem with my tests.
Okay, so race condition bugs are typical when multiple process share resources. If I were you, I'd look into the --initializer
and --finalizer
options to make it so that each test worker process sets up and tears down its own SQLite database. Those options are there specifically to address this type of problem.
Or you could just stick to one worker process, and just have the tests run slower.
I'll look into those options more, but at first glance I'm not sure that they'll be ideal for my usage case - I actually don't want the SQLite database to exist for the entirety of testing.
I don't mind running with a single worker so I'll just stick with that.
Thanks for your help. I'll close this and just open a new issue if I continue to have problems.
You're welcome. I hope it's smooth sailing for you from here on out! :-)
Summary
I'm getting an error every once in a while when running
green PyBank -vvv
on my PyBank program.The odd thing is that I'll run it once, get the error, and then run it again with no issue.
I'm trying to come up with a way to reproduce it, but I haven't found a reliable method yet.
In addition, sometimes the test runner hangs. When it does, i've seen it hang on two different tests:
test_sqlite_iterdump
in\tests\test_orm.py
test_get_salt_populates_file
in\tests\test_crypto.py
Pressing CTRL+C results in the following error:
I'm not yet sure if this is related or not.
I've never seen the AttributeError nor the hang when running tests on Travis or Appveyor.
Versions and Environment
Python 3.4.3 64-bit WinPython 3.4.3.2 Running in Windows CMD Windows 7 Professional, SP2, 64-bit Green v2.2.0
What can I do to help debug this issue?
Error text: