spec/cuboid/rpc/server/scheduler_spec.rb in cuboid-0.1.9.1 vs spec/cuboid/rpc/server/scheduler_spec.rb in cuboid-0.2
- old
+ new
@@ -6,11 +6,11 @@
before( :each ) do
Cuboid::Options.system.max_slots = 10
Cuboid::Options.scheduler.ping_interval = 0.5
end
- subject { scheduler_spawn( application: "#{fixtures_path}/mock_app.rb" ) }
+ subject { scheduler_spawn( application: "#{fixtures_path}/mock_app.rb", daemonize: true ) }
let(:options) { {} }
context 'when there are queued scans' do
it 'performs them' do
expect(subject.completed).to be_empty
@@ -51,13 +51,13 @@
expect(Cuboid::Processes::Manager.alive?( pid )).to be false
end
end
context 'when a Agent has been set' do
- subject { Cuboid::Processes::Schedulers.spawn agent: agent.url }
+ subject { Cuboid::Processes::Schedulers.spawn agent: agent.url, daemonize: true }
let(:agent) do
- Cuboid::Processes::Agents.spawn( application: "#{fixtures_path}/mock_app.rb" )
+ Cuboid::Processes::Agents.spawn( application: "#{fixtures_path}/mock_app.rb", daemonize: true )
end
it 'gets Instances from it' do
expect(agent.finished_instances).to be_empty
@@ -209,11 +209,11 @@
end
end
end
describe '#attach' do
- let(:client) { instance_spawn( application: "#{fixtures_path}/mock_app.rb" ) }
+ let(:client) { instance_spawn( application: "#{fixtures_path}/mock_app.rb", daemonize: true ) }
it 'attaches a running Instance to the queue' do
expect(subject.attach( client.url, client.token )).to eq client.token
id = client.token
@@ -247,10 +247,10 @@
expect(client.scheduler_url).to be_nil
subject.attach( client.url, client.token )
expect(client.scheduler_url).to eq subject.url
- q = scheduler_spawn
+ q = scheduler_spawn( daemonize: true )
expect(q.attach( client.url, client.token )).to be_falsey
expect(client.scheduler_url).to eq subject.url
end
end