We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 23b18bf commit a906d55Copy full SHA for a906d55
test/worker_test.rb
@@ -689,5 +689,28 @@ def self.perform( run_time, rescue_time=nil )
689
end
690
691
692
+
693
+ class SuicidalJob
694
+ @queue = :jobs
695
696
+ def self.perform
697
+ Process.kill('KILL', Process.pid)
698
+ end
699
700
+ def self.on_failure_store_exception(exc, *args)
701
+ @@failure_exception = exc
702
703
704
705
+ it "will notify failure hooks when a job is killed by a signal" do
706
+ begin
707
+ $TESTING = false
708
+ Resque.enqueue(SuicidalJob)
709
+ @worker.work(0)
710
+ assert_equal Resque::DirtyExit, SuicidalJob.class_variable_get(:@@failure_exception).class
711
+ ensure
712
+ $TESTING = true
713
714
715
716
0 commit comments