test(tui): isolate full-suite approval and policy fixtures

Use the existing approval timeout override guard when testing heartbeat ordering, pass an explicit managed-policy environment snapshot, clear output-limit overrides in the uncatalogued route test, and give the operator proxy success path a scheduling watchdog instead of a two-second bound.

The exact hermetic workspace libtest gate passed twice with 13456 TUI tests and zero failures. CI nextest passed 16753 selected tests; formatting and CI-policy Clippy passed. PDF failure during diagnosis coincided with exhausted /tmp inodes and passed after cleanup without a code change.

Refs #6665
This commit is contained in:
Paulo Aboim Pinto committed 2026-09-27 03:31:30 +02:00
1 parent 2d9613bac0
commit 45017fa532
4 files changed
+24 -4

No files matched your search

+11 -1
View File
@@ -549,7 +549,17 @@ mod tests {
listener,
"HTTP/1.1 200 OK\r\nConnection: close\r\nContent-Length: 2\r\n\r\nok".to_string(),
));
let configured = client(url, false);
// This path proves proxy routing, not a two-second scheduling bound.
let configured = McpHttpClient::new(
url,
false,
false,
false,
None,
Duration::from_secs(5),
Duration::from_secs(10),
)
.unwrap();
assert_eq!(
configured
.send(configured.get(url))
+7 -3
View File
@@ -1892,7 +1892,6 @@ fn malformed_managed_policy_fails_closed() {
#[test]
fn managed_policy_path_env_override_is_honored() {
let _lock = crate::test_support::lock_test_env();
let tmp = tempfile::tempdir().unwrap();
let config = config(tmp.path());
write_plugin(&config, "");
@@ -1904,8 +1903,13 @@ fn managed_policy_path_env_override_is_honored() {
"the default sibling must stay absent so the override is proven"
);
let _guard = crate::test_support::EnvVarGuard::set(MANAGED_POLICY_PATH_ENV, &custom);
let mut registry = discover_with_config(&config);
let environment = super::context::HostEnvironment::from_entries([(
std::ffi::OsString::from(MANAGED_POLICY_PATH_ENV),
custom.as_os_str().to_os_string(),
)]);
let context =
super::context::PluginDiscoveryContext::from_config_and_environment(&config, environment);
let mut registry = super::discovery::discover_with_context(&config, context);
assert_eq!(
registry.managed_policy_path(),
Some(custom.as_path()),
+3
View File
@@ -528,6 +528,9 @@ mod tests {
/// conservative compatibility ceiling, with an attributable source.
#[test]
fn uncatalogued_remote_model_keeps_a_conservative_ceiling() {
let _lock = crate::test_support::lock_test_env();
let _canonical = crate::test_support::EnvVarGuard::remove("CODEWHALE_MAX_OUTPUT_TOKENS");
let _legacy = crate::test_support::EnvVarGuard::remove("DEEPSEEK_MAX_OUTPUT_TOKENS");
let source = output_ceiling_source(ApiProvider::Openai, "totally-unknown-alias-v9");
assert_eq!(
source,
+3
View File
@@ -13996,6 +13996,9 @@ async fn terminal_turn_cancels_pending_dynamic_tool_exactly_once() -> Result<()>
/// reads as a live claim that the (already answered) call is still waiting.
#[tokio::test]
async fn approval_wait_heartbeat_is_never_sequenced_after_the_decision() -> Result<()> {
// The timeout test changes a process-wide override to 25 ms. This case
// checks heartbeat ordering while a decision is still pending.
let _timeout_guard = test_approval_timeout_ms(0);
let manager = test_manager(test_runtime_dir())?;
let thread = manager
.create_thread(CreateThreadRequest::default())