Unify test provider creation and cleanup.