mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 01:41:05 -05:00
Added an order by to the check_job_status query. The test was failing intermittently
This commit is contained in:
@@ -392,7 +392,7 @@ def check_job_status():
|
|||||||
jobs_not_complete_after_30_minutes = Job.query.filter(
|
jobs_not_complete_after_30_minutes = Job.query.filter(
|
||||||
Job.job_status == JOB_STATUS_IN_PROGRESS,
|
Job.job_status == JOB_STATUS_IN_PROGRESS,
|
||||||
and_(thirty_five_minutes_ago < Job.processing_started, Job.processing_started < thirty_minutes_ago)
|
and_(thirty_five_minutes_ago < Job.processing_started, Job.processing_started < thirty_minutes_ago)
|
||||||
).all()
|
).order_by(Job.processing_started).all()
|
||||||
|
|
||||||
job_ids = [str(x.id) for x in jobs_not_complete_after_30_minutes]
|
job_ids = [str(x.id) for x in jobs_not_complete_after_30_minutes]
|
||||||
if job_ids:
|
if job_ids:
|
||||||
|
|||||||
@@ -831,6 +831,6 @@ def test_check_job_status_task_raises_job_incomplete_error_for_multiple_jobs(moc
|
|||||||
|
|
||||||
mock_celery.assert_called_once_with(
|
mock_celery.assert_called_once_with(
|
||||||
name=TaskNames.PROCESS_INCOMPLETE_JOBS,
|
name=TaskNames.PROCESS_INCOMPLETE_JOBS,
|
||||||
args=([str(job_2.id), str(job.id)],),
|
args=([str(job.id), str(job_2.id)],),
|
||||||
queue=QueueNames.JOBS
|
queue=QueueNames.JOBS
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user