From c9bac17bbf41fa21a9ac2005dab434180c74a3be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ralph=20K=C3=BCpper?= Date: Wed, 22 Jul 2026 21:49:26 +0200 Subject: [PATCH 1/2] test(runtime): clear the C5a per-key vetting sets in the inline-guard test reset (CodeRabbit on #6802) The sets are production-monotonic by design; without clearing them the cfg(test) reset left earlier tests' declared-field / installed-key state visible to later tests reusing a key name, making the disable decision order-dependent. --- crates/perry-runtime/src/object/descriptor_state.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/perry-runtime/src/object/descriptor_state.rs b/crates/perry-runtime/src/object/descriptor_state.rs index 79191092ff7..2a3d512d12b 100644 --- a/crates/perry-runtime/src/object/descriptor_state.rs +++ b/crates/perry-runtime/src/object/descriptor_state.rs @@ -147,6 +147,16 @@ pub(crate) fn class_field_inline_guard_enabled() -> bool { #[cfg(test)] pub(crate) fn test_reset_class_field_inline_guard() { PERRY_CLASS_FIELD_INLINE_GUARD_DISABLED.store(0, Ordering::Relaxed); + // Also clear the C5a per-key vetting sets (production-monotonic, so + // without this a key name reused across tests in one process would + // inherit an earlier test's declared-field / installed-key state and + // make the disable decision order-dependent (CodeRabbit on #6802). + if let Ok(mut guard) = DECLARED_FIELD_NAME_HASHES.write() { + guard.take(); + } + if let Ok(mut guard) = PROTO_DESCRIPTOR_KEY_HASHES.write() { + guard.take(); + } } /// #5654: flip the process-wide inline gate only when the descriptor target can From c3e40423e034eb01416d85c72c0b1b43be98f508 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ralph=20K=C3=BCpper?= Date: Wed, 22 Jul 2026 21:49:38 +0200 Subject: [PATCH 2/2] docs(changelog): changeset for test-reset follow-up --- changelog.d/6805-test-reset-c5a-sets.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/6805-test-reset-c5a-sets.md diff --git a/changelog.d/6805-test-reset-c5a-sets.md b/changelog.d/6805-test-reset-c5a-sets.md new file mode 100644 index 00000000000..9c9c0a501f6 --- /dev/null +++ b/changelog.d/6805-test-reset-c5a-sets.md @@ -0,0 +1 @@ +test(runtime): the class-field inline-guard test reset also clears the C5a per-key vetting hash sets, removing cross-test order dependence for reused key names (CodeRabbit follow-up on #6802).