From f803288f7515acf407899c64dc437591c60ea7b1 Mon Sep 17 00:00:00 2001 From: Matthew Pomes Date: Sat, 10 Aug 2024 00:36:13 -0500 Subject: [PATCH] Update tests to set secret key so they work on release --- core/lib/tests/drop-in-async-context.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/lib/tests/drop-in-async-context.rs b/core/lib/tests/drop-in-async-context.rs index cfe8a318..80ee09d5 100644 --- a/core/lib/tests/drop-in-async-context.rs +++ b/core/lib/tests/drop-in-async-context.rs @@ -1,7 +1,8 @@ #[macro_use] extern crate rocket; -use rocket::{build, fairing::AdHoc, Build, Orbit, Rocket}; +use figment::Figment; +use rocket::{custom, fairing::AdHoc, Build, Orbit, Rocket, config::SecretKey}; struct AsyncDropInAsync; @@ -16,7 +17,10 @@ impl Drop for AsyncDropInAsync { } fn rocket() -> Rocket { - build().manage(AsyncDropInAsync).attach(AdHoc::on_liftoff( + let mut config = rocket::Config::default(); + config.secret_key = SecretKey::generate().unwrap(); + let figment = Figment::from(config); + custom(figment).manage(AsyncDropInAsync).attach(AdHoc::on_liftoff( "Shutdown immediately", |rocket: &Rocket| { Box::pin(async {