django-nose
django-nose copied to clipboard
nose taking 15 seconds even when there is no test
I'm using mysql version 5.5 on os-X and using django-nose with REUSE_DB =1 and number of tests is 0 but still running
python manage.py test
takes roughly 15 seconds to run .
looking at mysql logs shows that the culprit is ALTER TABLE query
my logs :
121024 10:16:53 65 Connect rohitjangid@localhost as on
65 Quit
66 Connect root@localhost on test_navibank2
66 Query SET NAMES utf8
66 Query set autocommit=0
121024 10:16:54 66 Query SHOW TABLES
66 Query ALTER TABLE auth_permission AUTO_INCREMENT = 1
121024 10:16:55 67 Connect rohitjangid@localhost as on
67 Quit
66 Query ALTER TABLE auth_group AUTO_INCREMENT = 1
121024 10:16:56 66 Query ALTER TABLE auth_user AUTO_INCREMENT = 1
66 Query ALTER TABLE auth_message AUTO_INCREMENT = 1
66 Query ALTER TABLE django_content_type AUTO_INCREMENT = 1
121024 10:16:57 68 Connect rohitjangid@localhost as on
68 Quit
66 Query ALTER TABLE django_site AUTO_INCREMENT = 1
66 Query ALTER TABLE bankaccount_user_profile AUTO_INCREMENT = 1
66 Query ALTER TABLE bankaccount_hospital AUTO_INCREMENT = 1
66 Query ALTER TABLE bankaccount_copprofile AUTO_INCREMENT = 1
66 Query ALTER TABLE bankaccount_wealth_history AUTO_INCREMENT = 1
121024 10:16:58 66 Query ALTER TABLE bankaccount_biometrichistory AUTO_INCREMENT = 1
66 Query ALTER TABLE bankaccount_cop_patient AUTO_INCREMENT = 1
121024 10:16:59 66 Query ALTER TABLE bankaccount_friends AUTO_INCREMENT = 1
69 Connect rohitjangid@localhost as on
69 Quit
66 Query ALTER TABLE bankaccount_policeslog AUTO_INCREMENT = 1
66 Query ALTER TABLE business_businessdb AUTO_INCREMENT = 1
66 Query ALTER TABLE business_businesslog AUTO_INCREMENT = 1
121024 10:17:00 66 Query ALTER TABLE dummy_dummygroups AUTO_INCREMENT = 1
66 Query ALTER TABLE dummy_dummys AUTO_INCREMENT = 1
66 Query ALTER TABLE dummy_dummynames AUTO_INCREMENT = 1
66 Query ALTER TABLE dummy_dummymeasuretowealthmaps AUTO_INCREMENT = 1
121024 10:17:01 66 Query ALTER TABLE dummy_dummyingredientmappings AUTO_INCREMENT = 1
70 Connect rohitjangid@localhost as on
70 Quit
66 Query ALTER TABLE dummy_dummylogs AUTO_INCREMENT = 1
66 Query ALTER TABLE dummy_bankvalet AUTO_INCREMENT = 1
66 Query ALTER TABLE dummy_clutter AUTO_INCREMENT = 1
66 Query ALTER TABLE dummy_userdummys AUTO_INCREMENT = 1
121024 10:17:02 66 Query ALTER TABLE dummy_userdummyingredientmappings AUTO_INCREMENT = 1
66 Query ALTER TABLE dummy_userdummymeasuretowealthmaps AUTO_INCREMENT = 1
66 Query ALTER TABLE dummy_advice AUTO_INCREMENT = 1
66 Query ALTER TABLE dummy_iflmylogs AUTO_INCREMENT = 1
66 Query ALTER TABLE django_admin_log AUTO_INCREMENT = 1
121024 10:17:03 71 Connect rohitjangid@localhost as on
71 Quit
66 Query ALTER TABLE feedback_feedback AUTO_INCREMENT = 1
66 Query ALTER TABLE feedback_recipesuggestion AUTO_INCREMENT = 1
66 Query ALTER TABLE facebook_facebookprofile AUTO_INCREMENT = 1
66 Query ALTER TABLE tastypie_apiaccess AUTO_INCREMENT = 1
121024 10:17:04 66 Query ALTER TABLE tastypie_apikey AUTO_INCREMENT = 1
66 Query ALTER TABLE celery_taskmeta AUTO_INCREMENT = 1
66 Query ALTER TABLE celery_tasksetmeta AUTO_INCREMENT = 1
66 Query ALTER TABLE djcelery_intervalschedule AUTO_INCREMENT = 1
66 Query ALTER TABLE djcelery_crontabschedule AUTO_INCREMENT = 1
121024 10:17:05 72 Connect rohitjangid@localhost as on
72 Quit
66 Query ALTER TABLE djcelery_periodictask AUTO_INCREMENT = 1
66 Query ALTER TABLE djcelery_workerstate AUTO_INCREMENT = 1
66 Query ALTER TABLE djcelery_taskstate AUTO_INCREMENT = 1
121024 10:17:06 66 Query commit
66 Query CREATE TABLE ROLLBACK_TEST (X INT)
121024 10:17:07 73 Connect rohitjangid@localhost as on
73 Quit
66 Query commit
66 Query INSERT INTO ROLLBACK_TEST (X) VALUES (8)
66 Query rollback
66 Query SELECT COUNT(X) FROM ROLLBACK_TEST
66 Query DROP TABLE ROLLBACK_TEST
66 Query commit
66 Query CREATE TABLE INTROSPECT_TEST (X INT)
66 Query SHOW TABLE STATUS WHERE Name="INTROSPECT_TEST"
66 Query DROP TABLE INTROSPECT_TEST
66 Quit
It's only taking you 15 seconds? It takes me 90 seconds to run zero tests with REUSE_DB=1 over here!
The culprit is the code that resets sequences; once I commented that out, the tests (with REUSE_DB=1) started immediately. Since I never write tests that depend on the values of implicitly auto-incremented fields, I feel the sequence resets obviate much of the advantage of RESET_DB=1.
On TravisCI, the MySQL tests run about the same speed as the PostgreSQL tests, and it seems faster than 15 seconds. Is this better in django-nose 1.4 for you?