Closed Bug 1261725 Opened 9 years ago Closed 9 years ago

Tox tests are slow with coverage

Categories

(Release Engineering Graveyard :: Applications: Balrog (backend), defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: nthomas, Unassigned)

Details

While doing some development I noticed that the tests seem to run slower under tox than the old Makefile/nose call. And that there seems to be migrate output whenever you get a test failures. I don't recall the latter, so I'm making a tenuous connection between the two. Could be completely bogus, but can't the DB be created directly with the latest schema, and do one migration test elsewhere (we're probably doing this already).
(In reply to Nick Thomas [:nthomas] from comment #0) > While doing some development I noticed that the tests seem to run slower > under tox than the old Makefile/nose call. And that there seems to be > migrate output whenever you get a test failures. I don't recall the latter, > so I'm making a tenuous connection between the two. > > Could be completely bogus, but can't the DB be created directly with the > latest schema, and do one migration test elsewhere (we're probably doing > this already). I looked into this a bit and it looks like enabling coverage slows things down, especially when doing so with pytest in tox. A few quick tests I ran: py.test (no tox): 27s py.test (tox): 28s py.test+cov (no tox): 32s py.test+cov (tox): 47s nose (no tox): 23s nose (tox): 23s nose+cov (no tox): 29s nose+cov (tox): 29s In all of the above cases, we're using migrate create the db (I verified by making the admin CSRF test fail and checking the log output). So, py.test is clearly slower than nose, and it seems to have particular issues with coverage inside of tox. I haven't dug into this any further. We do have a schema vs. model test (https://github.com/mozilla/balrog/blob/master/auslib/test/test_db.py#L1775), so I think it's fine to move the other ones away from migrating their db, though it's not clear how much that would help here.
Thanks for digging, the numbers are very helpful. I think this is just 'suck it up Nick' --> WONTFIX.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
Summary: Tox tests are slow because they migrate the db on each setup ? → Tox tests are slow with coverage
https://pypi.python.org/pypi/detox lets you run multiple test environments in parallel. It's nice win for me but once we drop py26 it'll evaporate.
Product: Release Engineering → Release Engineering Graveyard
You need to log in before you can comment on or make changes to this bug.