Skip to content

Commit

Permalink
Simplify test_panic_in_handler test
Browse files Browse the repository at this point in the history
  • Loading branch information
rustworthy committed Aug 18, 2024
1 parent 25c0fe5 commit 58d6231
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions tests/real/community.rs
Original file line number Diff line number Diff line change
Expand Up @@ -730,23 +730,17 @@ async fn test_panic_in_handler() {

let mut w = Worker::builder::<io::Error>()
.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
.unwrap();

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();
Expand Down

0 comments on commit 58d6231

Please sign in to comment.