Closed rafatower closed 6 years ago
Here's how I reproduced the issue in local:
$ pip install pytest-repeat
$ py.test --count=100 -x -s -v -k 'test_batch_create' tests/test_sql.py
...
tests/test_sql.py::test_batch_create[70/100] PASSED
tests/test_sql.py::test_batch_create[71/100] PASSED
tests/test_sql.py::test_batch_create[72/100] FAILED
======================================================================================================================================== FAILURES ========================================================================================================================================
_______________________________________________________________________________________________________________________________ test_batch_create[72/100] ________________________________________________________________________________________________________________________________
api_key_auth_client_usr = <carto.auth.APIKeyAuthClient object at 0x7f4190b651d0>
def test_batch_create(api_key_auth_client_usr):
sql = BatchSQLClient(api_key_auth_client_usr)
# Create query
data = sql.create(BATCH_SQL_SINGLE_QUERY)
# Update status
job_id = data['job_id']
# Cancel if not finished
try:
confirmation = sql.cancel(job_id)
except CartoException:
pass
else:
> assert confirmation == 'cancelled'
E AssertionError: assert 'running' == 'cancelled'
E - running
E + cancelled
tests/test_sql.py:74: AssertionError
As stated in the NEWS, this PR does 2 things:
I did this because I was a bit fed up of a couple tests failing randomly:
https://travis-ci.org/CartoDB/carto-python/jobs/418121501 https://travis-ci.org/CartoDB/carto-python/jobs/418210293 https://travis-ci.org/CartoDB/carto-python/jobs/418210297