Skip to content

Commit

Permalink
[Test-suite] bugfix: specifically run these job_ids because the order…
Browse files Browse the repository at this point in the history
… by which jobs are claimed and run is not guaranteed
  • Loading branch information
muffato authored and ens-bwalts committed Jan 30, 2020
1 parent 41258f3 commit 7b3bdf4
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions t/03.scripts/beekeeper_reset.t
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,12 @@ foreach my $pipeline_url (@$ehive_test_pipeline_urls) {
my $hive_url = $hive_dba->dbc->url;
my $job_adaptor = $hive_dba->get_AnalysisJobAdaptor;

# First run a single worker in this process. It will run the factory and some FailureTest jobs.
runWorker($pipeline_url, [ '-can_respecialize' ]);
# First run some jobs. job_id 3 is attempted twice to go over
# max_retry_count and switch to FAILED
foreach my $job_id (1,3,4,5,6,7,3) {
runWorker($pipeline_url, [ '-job_id' => $job_id ]);
}

# We're now in a state with a selection of DONE, READY, FAILED and SEMAPHORED jobs

# Tip: SELECT CONCAT('[', GROUP_CONCAT( CONCAT('["',status,'",', retry_count, ',',COALESCE(local_jobs_counter+remote_jobs_counter,0),']') ), ']') FROM job j LEFT JOIN semaphore s ON (j.job_id=s.dependent_job_id) ORDER BY job_id;
Expand Down Expand Up @@ -112,7 +116,9 @@ foreach my $pipeline_url (@$ehive_test_pipeline_urls) {
assert_jobs($job_adaptor, [["DONE",0,0],["SEMAPHORED",0,3],["DONE",2,0],["DONE",1,0],["READY",1,0],["READY",1,0],["READY",1,0]] );

# Run another worker to get more failures
runWorker($pipeline_url);
foreach my $job_id (4,5,6,7) {
runWorker($pipeline_url, [ '-job_id' => $job_id ]);
}
assert_jobs($job_adaptor, [["DONE",0,0],["SEMAPHORED",0,2],["DONE",2,0],["DONE",1,0],["FAILED",2,0],["DONE",1,0],["FAILED",2,0]] );

# Reset FAILED jobs
Expand Down

0 comments on commit 7b3bdf4

Please sign in to comment.