9 my @jm_jobs = qw(fsck delete replicate);
12 my $sto = eval { temp_store(); };
14 plan skip_all => "Can't create temporary test database: $@";
18 my $tmptrack = create_temp_tracker($sto, ["--no-job_master"]);
19 my $admin = IO::Socket::INET->new(PeerAddr => '127.0.0.1:7001');
20 $admin or die "failed to create admin socket: $!";
26 syswrite($admin, "!jobs\r\n");
27 MogileFS::Util::wait_for_readability(fileno($admin), 10);
32 $line =~ /^(\w+ \w+)\s*(.*)$/ or die "Failed to parse $line\n";
38 ok(try_for(30, sub { jobs($admin)->{"queryworker count"} }), "wait for queryworker");
41 foreach my $job (@jm_jobs) {
42 ok(!$jobs->{"$job count"}, "no $job workers");
46 want($admin, 1, "job_master");
48 ok(try_for(30, sub { jobs($admin)->{"queryworker count"} }), "wait for queryworker");
50 foreach my $job (@jm_jobs) {
51 ok(try_for(30, sub { jobs($admin)->{"$job count"} }), "wait for $job");
54 # disable job_master again
55 want($admin, 0, "job_master");
57 foreach my $job (@jm_jobs) {
58 ok(try_for(30, sub { !jobs($admin)->{"$job count"} }), "wait for $job to die");