Skip to content

Commit a03b641

Browse files
authored
Merge pull request #2147 from antgonza/improving-tests
WIP: improve time for tests
2 parents 4caaec7 + cec7ca4 commit a03b641

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ install:
2727
'pandas>=0.18' 'matplotlib>=1.1.0' 'scipy>0.13.0' 'numpy>=1.7' 'h5py>=2.3.1'
2828
- source activate qiita
2929
- pip install -U pip
30-
- pip install sphinx sphinx-bootstrap-theme coveralls 'ipython[all]==2.4.1'
30+
- pip install sphinx sphinx-bootstrap-theme coveralls 'ipython[all]==2.4.1' nose-timer
3131
- travis_retry pip install . --process-dependency-links
3232
- 'echo "backend: Agg" > matplotlibrc'
3333
# Install the biom plugin so we can run the analysis tests
@@ -56,7 +56,7 @@ script:
5656
- if [ ${TEST_ADD_STUDIES} == "True" ]; then test_data_studies/commands.sh ; fi
5757
- if [ ${TEST_ADD_STUDIES} == "True" ]; then qiita-cron-job ; fi
5858
- if [ ${TEST_ADD_STUDIES} == "False" ]; then qiita-test-install ; fi
59-
- if [ ${TEST_ADD_STUDIES} == "False" ]; then nosetests --with-doctest --with-coverage -v --cover-package=qiita_db,qiita_pet,qiita_core,qiita_ware; fi
59+
- if [ ${TEST_ADD_STUDIES} == "False" ]; then nosetests --with-doctest --with-coverage --with-timer -v --cover-package=qiita_db,qiita_pet,qiita_core,qiita_ware; fi
6060
- flake8 qiita_* setup.py scripts/*
6161
- ls -R /home/travis/miniconda3/envs/qiita/lib/python2.7/site-packages/qiita_pet/support_files/doc/
6262
- qiita pet webserver

qiita_db/analysis.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,10 @@ def create(cls, owner, name, description, from_default=False,
183183
VALUES (%s, %s)"""
184184
qdb.sql_connection.TRN.add(sql, [a_id, job.id])
185185
qdb.sql_connection.TRN.execute()
186-
job.submit()
187-
return instance
186+
187+
# Doing the submission outside of the transaction
188+
job.submit()
189+
return instance
188190

189191
@classmethod
190192
def delete(cls, _id):

scripts/qiita

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,8 @@ def start(port, master):
464464
# Set a PeriodicCallback for cleaning up the threads every 10 seconds
465465
# To understand why this is working as expected, check the multiprocessing
466466
# documentation https://docs.python.org/2/library/multiprocessing.html
467-
PeriodicCallback(lambda: active_children(), 10000).start()
467+
# 600000 == 10 min
468+
PeriodicCallback(lambda: active_children(), 600000).start()
468469

469470
ioloop.start()
470471

0 commit comments

Comments
 (0)