Skip to content

Commit

Permalink
bugfix: beekeeper needs a config option turned on to clean up the tem…
Browse files Browse the repository at this point in the history
…p directories
  • Loading branch information
muffato authored and ens-bwalts committed Jul 1, 2020
1 parent e443e09 commit 28d5899
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions t/03.scripts/beekeeper_big_red_button.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"Meadow" : {
"CleanupTempDirectoryKilledWorkers" : 1
}
}
9 changes: 7 additions & 2 deletions t/03.scripts/beekeeper_big_red_button.t
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ $ENV{'EHIVE_ROOT_DIR'} //=
) );
my $local_module_path = $ENV{'EHIVE_ROOT_DIR'}.'/t/03.scripts/';

# The JSON config file to set CleanupTempDirectoryKilledWorkers to 1
my $json_config = $PROGRAM_NAME;
$json_config =~ s/\.t$/.json/;

# The name of the file that will be created in the temp directory
my $test_filename = 'foo';

Expand All @@ -58,11 +62,12 @@ my $pipeline_url = get_test_url_or_die();
my $hive_dba =
Bio::EnsEMBL::Hive::DBSQL::DBAdaptor->new( -url => $pipeline_url );

my $big_red_button_options = [ '-big_red_button', '-config_file', $json_config ];
# Check that the -big_red_button is recognised. Of course if it is it
# will trigger the shutdown - but all it does at this point is
# Beekeeper blocking itself, which has no effect because it doesn't
# actually try to run anything.
beekeeper( $pipeline_url, [ '-big_red_button' ], "beekeper.pl recognises option '-big_red_button'" );
beekeeper( $pipeline_url, $big_red_button_options, "beekeper.pl recognises option '-big_red_button'" );

# This will both spawn a worker to claim a job and register another
# beekeeper with the pipeline. Ideally we would run this one in loop
Expand All @@ -87,7 +92,7 @@ my $hello_path = "$temp_directory_name/$test_filename";
ok(-s $hello_path, "$hello_path file has been populated");

# Now trigger the shutdown for real
beekeeper( $pipeline_url, [ '-big_red_button' ], 'Pipeline shutdown triggered without errors' );
beekeeper( $pipeline_url, $big_red_button_options, 'Pipeline shutdown triggered without errors' );
# Give the worker(s) some time to die
sleep(10);

Expand Down

0 comments on commit 28d5899

Please sign in to comment.