spec/insque_spec.rb in insque-0.6.3 vs spec/insque_spec.rb in insque-0.7.0
- old
+ new
@@ -34,11 +34,11 @@
before(:all) do
system "docker swarm init || true"
system "docker stack deploy -c insque.local.yml insque"
sleep 10
Thread.abort_on_exception=true
- Insque.debug = true
+ Insque.logger.level = :error
Insque.sender = 'myapp'
Insque.inbox_ttl = 3
Insque.redis_config = { host: 'localhost', port: 63790 }
ActiveRecord::Base.establish_connection(
:adapter => 'sqlite3',
@@ -52,10 +52,13 @@
ActiveRecord::Base.connection.execute('drop table users;')
end
before(:each) do
Insque.redis.flushall
+ rescue
+ sleep 10
+ Insque.redis.flushall
end
it "can broadcast without listeners" do
Insque.broadcast :test, value: '123'
end
@@ -74,10 +77,10 @@
end
it "restarts broken message" do
janitor = Thread.new { Insque.janitor }
Insque.redis.lpush('{insque}processing_myapp', { message: 'myapp_test', broadcasted_at: 1.hour.ago }.to_json)
- sleep 3
+ sleep 4
expect(Insque.redis.llen '{insque}processing_myapp').to eq(0)
expect(Insque.redis.llen '{insque}inbox_myapp').to eq(1)
janitor.exit
end