From cfa179f2ce06b7e3aeb1ae53273e6e75fc85b28f Mon Sep 17 00:00:00 2001 From: Roman Borschel Date: Thu, 19 Mar 2020 13:53:16 +0100 Subject: [PATCH] Safe logger initialisation in test. (#5311) env_logger::init() can lead to panics on concurrent test execution. See: https://gitlab.parity.io/parity/substrate/-/jobs/422283 --- substrate/client/finality-grandpa/src/communication/tests.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/substrate/client/finality-grandpa/src/communication/tests.rs b/substrate/client/finality-grandpa/src/communication/tests.rs index f964cea469..7c9170a48e 100644 --- a/substrate/client/finality-grandpa/src/communication/tests.rs +++ b/substrate/client/finality-grandpa/src/communication/tests.rs @@ -357,7 +357,7 @@ fn good_commit_leads_to_relay() { #[test] fn bad_commit_leads_to_report() { - env_logger::init(); + let _ = env_logger::try_init(); let private = [Ed25519Keyring::Alice, Ed25519Keyring::Bob, Ed25519Keyring::Charlie]; let public = make_ids(&private[..]); let voter_set = Arc::new(public.iter().cloned().collect::>());