From 58d6231e02fc612a067660ef13c4175f532c7d77 Mon Sep 17 00:00:00 2001 From: Pavel Mikhalkevich Date: Sun, 18 Aug 2024 16:49:49 +0400 Subject: [PATCH] Simplify test_panic_in_handler test --- tests/real/community.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tests/real/community.rs b/tests/real/community.rs index ceef348c..5eb25063 100644 --- a/tests/real/community.rs +++ b/tests/real/community.rs @@ -730,14 +730,10 @@ async fn test_panic_in_handler() { let mut w = Worker::builder::() .register_blocking_fn("panic_SYNC_handler", |_j| { - panic!("Panic inside the handler..."); + panic!("Panic inside sync the handler..."); }) - .register_fn("panic_ASYNC_handler", |j| async move { - // potentially going out of bounds - let arg1 = &j.args()[0]; - let arg2 = &j.args()[1]; - let _ = arg1.as_i64().unwrap() + arg2.as_i64().unwrap(); - Ok::<(), io::Error>(()) + .register_fn("panic_ASYNC_handler", |_j| async move { + panic!("Panic inside async handler..."); }) .connect(None) .await @@ -745,8 +741,6 @@ async fn test_panic_in_handler() { let mut c = Client::connect(None).await.unwrap(); - // note how we are not specifying any args for this job, - // so indexing into `job.args()` will panic c.enqueue(Job::builder("panic_SYNC_handler").queue(local).build()) .await .unwrap();