Context
In tests/steps/config_steps.rs at line 136, the Drop implementation for ConfigWorld releases env_guard before socket_guard:
impl Drop for ConfigWorld {
fn drop(&mut self) {
if let Some(_guard) = self.env_guard.take() {
// dropping the guard restores the previous state
}
if let Some(_guard) = self.socket_guard.take() {
// dropping the guard restores the previous state
}
}
}
Issue
If a future scenario sets COMENQD_SOCKET_PATH before calling config_file_with_token, the current drop order could reintroduce the environment variable on drop, leading to unexpected test behaviour.
Recommendation
Consider dropping socket_guard first or consolidating guards for the same key to avoid ordering surprises.
References
Context
In
tests/steps/config_steps.rsat line 136, theDropimplementation forConfigWorldreleasesenv_guardbeforesocket_guard:Issue
If a future scenario sets
COMENQD_SOCKET_PATHbefore callingconfig_file_with_token, the current drop order could reintroduce the environment variable on drop, leading to unexpected test behaviour.Recommendation
Consider dropping
socket_guardfirst or consolidating guards for the same key to avoid ordering surprises.References