Skip to content

Commit

Permalink
reset the original allocation for the jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
antgonza committed Jul 13, 2023
1 parent f902e87 commit 36de016
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions qiita_db/test/test_processing_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,12 @@ def test_shape_special_cases(self):
qdb.sql_connection.perform_as_transaction(sql)
self.assertEqual(sra, pj.get_resource_allocation_info())

# return allocation
sql = ("UPDATE qiita.processing_job_resource_allocation "
f"SET allocation = '{current_allocation}'"
f"WHERE name = '{command.name}'")
qdb.sql_connection.perform_as_transaction(sql)

def test_get_resource_allocation_info(self):
jids = {
# Split libraries FASTQ
Expand Down Expand Up @@ -891,6 +897,13 @@ def _set_allocation(memory):
self.assertEqual(job_changed.get_resource_allocation_info(),
'-p qiita --mem 2G')

# restore allocation
sql = ("UPDATE qiita.processing_job_resource_allocation "
"SET allocation = '-p qiita -N 1 -n 1 --mem 120gb "
"--time 80:00:00' "
"WHERE name = 'Split libraries FASTQ'")
qdb.sql_connection.perform_as_transaction(sql)

def test_notification_mail_generation(self):
# Almost all processing-jobs in testing are owned by test@foo.bar
# and are of type 'Split libraries FASTQ'.
Expand Down

0 comments on commit 36de016

Please sign in to comment.