From c17d7a94e8f0b84fdd9e8415163f548207bff972 Mon Sep 17 00:00:00 2001 From: mohiiit Date: Sat, 9 Nov 2024 07:52:55 +0530 Subject: [PATCH] refactor: removed job id from panic message, was redundant --- crates/orchestrator/src/jobs/mod.rs | 2 +- crates/orchestrator/src/tests/jobs/mod.rs | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/crates/orchestrator/src/jobs/mod.rs b/crates/orchestrator/src/jobs/mod.rs index 46aac6ef..e86aa984 100644 --- a/crates/orchestrator/src/jobs/mod.rs +++ b/crates/orchestrator/src/jobs/mod.rs @@ -252,7 +252,7 @@ pub async fn process_job(id: Uuid, config: Arc) -> Result<(), JobError> return move_job_to_failed( &job, config.clone(), - format!("Job handler panicked in job with id: {} and panic message: {}", id, panic_msg), + format!("Job handler panicked with message: {}", panic_msg), ) .await; } diff --git a/crates/orchestrator/src/tests/jobs/mod.rs b/crates/orchestrator/src/tests/jobs/mod.rs index 75604b5d..b10c66e8 100644 --- a/crates/orchestrator/src/tests/jobs/mod.rs +++ b/crates/orchestrator/src/tests/jobs/mod.rs @@ -231,13 +231,11 @@ async fn process_job_handles_panic() { let job_in_db = database_client.get_job_by_id(job_item.id).await.unwrap().unwrap(); assert_eq!(job_in_db.status, JobStatus::Failed); assert!( - job_in_db.metadata.get(JOB_METADATA_FAILURE_REASON).unwrap().contains( - format!( - "Job handler panicked in job with id: {} and panic message: Simulated panic in process_job", - job_item.id - ) - .as_str() - ) + job_in_db + .metadata + .get(JOB_METADATA_FAILURE_REASON) + .unwrap() + .contains("Job handler panicked with message: Simulated panic in process_job") ); }