Skip to content

Commit

Permalink
Put timeouts in place to see what is wrong on gha
Browse files Browse the repository at this point in the history
  • Loading branch information
glormph committed Oct 29, 2024
1 parent 2e7f633 commit 110dd8f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/backend/rawstatus/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,10 @@ def test_new_file(self):
self.assertFalse(sf.checked)
self.run_job()
sf.refresh_from_db()
spout, sperr = sp.communicate(timeout=10)
print(sperr.decode('utf-8'))
print(spout.decode('utf-8'))
self.assertTrue(sf.checked)
spout, sperr = sp.communicate()
explines = ['Registering 1 new file(s)',
f'File {new_raw.name} matches remote file {new_raw.name} with ID {new_raw.pk}',
f'Checking remote state for file {new_raw.name} with ID {new_raw.pk}',
Expand Down Expand Up @@ -154,7 +156,7 @@ def test_transfer_again(self):
self.f3sf.refresh_from_db()
self.assertFalse(self.f3sf.checked)
self.run_job()
spout, sperr = sp.communicate()
spout, sperr = sp.communicate(timeout=10)
self.f3sf.refresh_from_db()
self.assertTrue(self.f3sf.checked)
self.assertEqual(self.f3sf.md5, self.f3raw.source_md5)
Expand Down Expand Up @@ -232,7 +234,7 @@ def test_transfer_file_namechanged(self):
sp = self.run_script(fullp)
sleep(2)
self.run_job()
spout, sperr = sp.communicate()
spout, sperr = sp.communicate(timeout=10)
newsf = rm.StoredFile.objects.last()
self.assertEqual(newsf.pk, lastsf.pk + 1)
self.assertEqual(rawfn.pk, newsf.rawfile_id)
Expand Down Expand Up @@ -272,7 +274,7 @@ def test_rsync_not_finished_yet(self):
job.save()
self.f3sf.checked = True
self.f3sf.save()
spout, sperr = sp.communicate()
spout, sperr = sp.communicate(timeout=10)
explines = [f'Checking remote state for file {self.f3raw.name} with ID {self.f3raw.pk}',
f'State for file {self.f3raw.name} with ID {self.f3raw.pk} was: wait',
f'Checking remote state for file {self.f3raw.name} with ID {self.f3raw.pk}',
Expand Down

0 comments on commit 110dd8f

Please sign in to comment.