From 850b67c048bbf80d9739520d950f4dd1ed4190a5 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Tue, 4 Aug 2026 05:09:02 +0900 Subject: test(plugin): tolerate the _composer_tmp rename in the removal test The PHP worker is shared across the test binary, so whichever subscriber test runs first owns the bare class name and every later install registers the plugin under a _composer_tmpN rename (as upstream does). The exact-name lookup made the removal test depend on lock acquisition order. Co-Authored-By: Claude Fable 5 --- crates/shirabe/tests/plugin/subscriber_test.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'crates') diff --git a/crates/shirabe/tests/plugin/subscriber_test.rs b/crates/shirabe/tests/plugin/subscriber_test.rs index 1d6a7ece..a08d8d8d 100644 --- a/crates/shirabe/tests/plugin/subscriber_test.rs +++ b/crates/shirabe/tests/plugin/subscriber_test.rs @@ -104,12 +104,18 @@ fn test_remove_plugin_removes_its_subscribed_listeners() { assert_eq!(0, dispatch(&set_up, "post-install-cmd")); + // The worker is shared across tests: when another test already defined the plugin class, + // this install registered it under a `_composer_tmpN` rename (as upstream does). let plugin = set_up .pm .borrow() .get_plugins() .iter() - .find(|p| p.borrow().get_class_name() == "Subscriber\\Plugin") + .find(|p| { + p.borrow() + .get_class_name() + .starts_with("Subscriber\\Plugin") + }) .expect("the subscriber plugin is registered") .clone(); set_up.pm.borrow_mut().remove_plugin(&plugin).unwrap(); -- cgit v1.3.1