From f2b51a017b5f66b6879fb5ab587ca975fa70b65c Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Wed, 22 Sep 2021 20:53:04 +0000 Subject: [PATCH] Test Setup: fix evalSucceeds to actually output evaluation errors At the moment, the jobset object is unlikely to actually retrieve the evaluation error output, because it isn't refreshed after hydra-eval-jobsets is run. Explicitly calling DBIx::Class::Row->discard_changes causes any updated data to be refreshed, at the cost of losing any not-yet committed changes to the row. --- t/lib/Setup.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/t/lib/Setup.pm b/t/lib/Setup.pm index b80eea14..983a8c56 100644 --- a/t/lib/Setup.pm +++ b/t/lib/Setup.pm @@ -148,6 +148,7 @@ sub createJobsetWithOneInput { sub evalSucceeds { my ($jobset) = @_; my ($res, $stdout, $stderr) = captureStdoutStderr(60, ("hydra-eval-jobset", $jobset->project->name, $jobset->name)); + $jobset->discard_changes; # refresh from DB chomp $stdout; chomp $stderr; print STDERR "Evaluation errors for jobset ".$jobset->project->name.":".$jobset->name.": \n".$jobset->errormsg."\n" if $jobset->errormsg; print STDERR "STDOUT: $stdout\n" if $stdout ne "";