Tech debt - increase test timeouts to remove intermittant test failures (#3146)
This commit is contained in:
parent
1b80b0a810
commit
bed769a387
@ -443,8 +443,8 @@ class Job(threading.Thread, BaseModel):
|
|||||||
now = datetime.datetime.now()
|
now = datetime.datetime.now()
|
||||||
i = 1
|
i = 1
|
||||||
while container.status == "running" and not self.stop:
|
while container.status == "running" and not self.stop:
|
||||||
time.sleep(0.15)
|
time.sleep(0.2)
|
||||||
if i % 10 == 0:
|
if i % 5 == 0:
|
||||||
logs_stderr.extend(
|
logs_stderr.extend(
|
||||||
container.logs(
|
container.logs(
|
||||||
stdout=False,
|
stdout=False,
|
||||||
|
@ -6,6 +6,7 @@ import boto3
|
|||||||
from botocore.exceptions import ClientError
|
from botocore.exceptions import ClientError
|
||||||
import sure # noqa
|
import sure # noqa
|
||||||
from moto import mock_batch, mock_iam, mock_ec2, mock_ecs, mock_logs
|
from moto import mock_batch, mock_iam, mock_ec2, mock_ecs, mock_logs
|
||||||
|
|
||||||
import functools
|
import functools
|
||||||
import nose
|
import nose
|
||||||
|
|
||||||
@ -729,13 +730,13 @@ def test_submit_job():
|
|||||||
future = datetime.datetime.now() + datetime.timedelta(seconds=30)
|
future = datetime.datetime.now() + datetime.timedelta(seconds=30)
|
||||||
|
|
||||||
while datetime.datetime.now() < future:
|
while datetime.datetime.now() < future:
|
||||||
|
time.sleep(1)
|
||||||
resp = batch_client.describe_jobs(jobs=[job_id])
|
resp = batch_client.describe_jobs(jobs=[job_id])
|
||||||
|
|
||||||
if resp["jobs"][0]["status"] == "FAILED":
|
if resp["jobs"][0]["status"] == "FAILED":
|
||||||
raise RuntimeError("Batch job failed")
|
raise RuntimeError("Batch job failed")
|
||||||
if resp["jobs"][0]["status"] == "SUCCEEDED":
|
if resp["jobs"][0]["status"] == "SUCCEEDED":
|
||||||
break
|
break
|
||||||
time.sleep(0.5)
|
|
||||||
else:
|
else:
|
||||||
raise RuntimeError("Batch job timed out")
|
raise RuntimeError("Batch job timed out")
|
||||||
|
|
||||||
@ -872,7 +873,7 @@ def test_terminate_job():
|
|||||||
|
|
||||||
batch_client.terminate_job(jobId=job_id, reason="test_terminate")
|
batch_client.terminate_job(jobId=job_id, reason="test_terminate")
|
||||||
|
|
||||||
time.sleep(1)
|
time.sleep(2)
|
||||||
|
|
||||||
resp = batch_client.describe_jobs(jobs=[job_id])
|
resp = batch_client.describe_jobs(jobs=[job_id])
|
||||||
resp["jobs"][0]["jobName"].should.equal("test1")
|
resp["jobs"][0]["jobName"].should.equal("test1")
|
||||||
|
Loading…
Reference in New Issue
Block a user