diff --git a/polkadot/node/subsystem/src/util.rs b/polkadot/node/subsystem/src/util.rs index ce31bebeda..440fda08f0 100644 --- a/polkadot/node/subsystem/src/util.rs +++ b/polkadot/node/subsystem/src/util.rs @@ -715,7 +715,7 @@ where }); SpawnedSubsystem { - name: "JobManager", + name: Job::NAME.strip_suffix("Job").unwrap_or(Job::NAME), future, } } @@ -737,6 +737,8 @@ mod tests { ActiveLeavesUpdate, FromOverseer, OverseerSignal, + SpawnedSubsystem, + Subsystem, }; use futures::{ channel::mpsc, @@ -959,4 +961,16 @@ mod tests { ); }); } + + #[test] + fn test_subsystem_impl_and_name_derivation() { + let pool = sp_core::testing::TaskExecutor::new(); + let (context, _) = make_subsystem_context::(pool.clone()); + + let SpawnedSubsystem { name, .. } = FakeCandidateSelectionSubsystem::new( + pool, + HashMap::new(), + ).start(context); + assert_eq!(name, "FakeCandidateSelection"); + } }