@@ -28,23 +28,36 @@ def set_logger(logger)
28
28
29
29
test "recurring task enqueued succesfully" do
30
30
attach_log_subscriber
31
- instrument "enqueue_recurring_task.solid_queue" , task : :example_task , active_job_id : "b944ddbc-6a37-43c0-b661-4b56e57195f5" , at : Time . now
31
+ time = Time . now
32
+ instrument "enqueue_recurring_task.solid_queue" , task : :example_task , active_job_id : "b944ddbc-6a37-43c0-b661-4b56e57195f5" , at : time
32
33
33
- assert_match_logged :info , "Enqueued recurring task" , "task: :example_task, active_job_id: \" b944ddbc-6a37-43c0-b661-4b56e57195f5\" "
34
+ assert_match_logged :info , "Enqueued recurring task" , "task: :example_task, active_job_id: \" b944ddbc-6a37-43c0-b661-4b56e57195f5\" , at: \" #{ time . iso8601 } \" "
34
35
end
35
36
36
37
test "recurring task skipped" do
37
38
attach_log_subscriber
38
- instrument "enqueue_recurring_task.solid_queue" , task : :example_task , skipped : true , at : Time . now
39
+ time = Time . now
40
+ instrument "enqueue_recurring_task.solid_queue" , task : :example_task , skipped : true , at : time
39
41
40
- assert_match_logged :info , "Skipped recurring task – already dispatched" , "task: :example_task"
42
+ assert_match_logged :info , "Skipped recurring task – already dispatched" , "task: :example_task, at: \" #{ time . iso8601 } \" "
41
43
end
42
44
43
45
test "error enqueuing recurring task" do
44
46
attach_log_subscriber
45
- instrument "enqueue_recurring_task.solid_queue" , task : :example_task , enqueue_error : "Everything is broken" , at : Time . now
47
+ time = Time . now
48
+ instrument "enqueue_recurring_task.solid_queue" , task : :example_task , enqueue_error : "Everything is broken" , at : time
46
49
47
- assert_match_logged :info , "Error enqueuing recurring task" , "task: :example_task, enqueue_error: \" Everything is broken\" "
50
+ assert_match_logged :info , "Error enqueuing recurring task" , "task: :example_task, enqueue_error: \" Everything is broken\" , at: \" #{ time . iso8601 } \" "
51
+ end
52
+
53
+ test "deregister process" do
54
+ process = SolidQueue ::Process . register ( kind : "Worker" , pid : 42 , hostname : "localhost" )
55
+ last_heartbeat_at = process . last_heartbeat_at . iso8601
56
+
57
+ attach_log_subscriber
58
+ instrument "deregister_process.solid_queue" , process : process , pruned : false
59
+
60
+ assert_match_logged :info , "Deregister Worker" , "process_id: #{ process . id } , pid: 42, hostname: \" localhost\" , last_heartbeat_at: \" #{ last_heartbeat_at } \" , claimed_size: 0, pruned: false"
48
61
end
49
62
50
63
private
0 commit comments