mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-09 12:40:20 +08:00
Fix sync CLI test stack overflow
This commit is contained in:
@@ -26,8 +26,40 @@ use aether_data_contracts::repository::provider_catalog::{
|
||||
use base64::Engine as _;
|
||||
use sha2::{Digest, Sha256};
|
||||
|
||||
#[tokio::test]
|
||||
async fn gateway_executes_openai_responses_sync_via_local_decision_gate_with_local_sync_decision() {
|
||||
const CLI_SYNC_TEST_STACK_BYTES: usize = 16 * 1024 * 1024;
|
||||
|
||||
fn run_cli_sync_test<F, Fut>(test_name: &'static str, make_future: F)
|
||||
where
|
||||
F: FnOnce() -> Fut + Send + 'static,
|
||||
Fut: std::future::Future<Output = ()> + 'static,
|
||||
{
|
||||
let handle = std::thread::Builder::new()
|
||||
.name(test_name.to_string())
|
||||
.stack_size(CLI_SYNC_TEST_STACK_BYTES)
|
||||
.spawn(move || {
|
||||
let runtime = tokio::runtime::Builder::new_current_thread()
|
||||
.enable_all()
|
||||
.build()
|
||||
.expect("test runtime should build");
|
||||
runtime.block_on(make_future());
|
||||
})
|
||||
.expect("cli sync test thread should spawn");
|
||||
|
||||
if let Err(payload) = handle.join() {
|
||||
std::panic::resume_unwind(payload);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn gateway_executes_openai_responses_sync_via_local_decision_gate_with_local_sync_decision() {
|
||||
run_cli_sync_test(
|
||||
"gateway_executes_openai_responses_sync_via_local_decision_gate_with_local_sync_decision",
|
||||
gateway_executes_openai_responses_sync_via_local_decision_gate_with_local_sync_decision_impl,
|
||||
);
|
||||
}
|
||||
|
||||
async fn gateway_executes_openai_responses_sync_via_local_decision_gate_with_local_sync_decision_impl(
|
||||
) {
|
||||
#[derive(Debug, Clone)]
|
||||
struct SeenExecutionRuntimeSyncRequest {
|
||||
trace_id: String,
|
||||
@@ -546,8 +578,15 @@ async fn gateway_executes_openai_responses_sync_via_local_decision_gate_with_loc
|
||||
upstream_handle.abort();
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn gateway_waits_for_api_key_concurrency_slot_then_executes_openai_responses_sync() {
|
||||
#[test]
|
||||
fn gateway_waits_for_api_key_concurrency_slot_then_executes_openai_responses_sync() {
|
||||
run_cli_sync_test(
|
||||
"gateway_waits_for_api_key_concurrency_slot_then_executes_openai_responses_sync",
|
||||
gateway_waits_for_api_key_concurrency_slot_then_executes_openai_responses_sync_impl,
|
||||
);
|
||||
}
|
||||
|
||||
async fn gateway_waits_for_api_key_concurrency_slot_then_executes_openai_responses_sync_impl() {
|
||||
fn hash_api_key(value: &str) -> String {
|
||||
let mut hasher = Sha256::new();
|
||||
hasher.update(value.as_bytes());
|
||||
@@ -929,8 +968,16 @@ async fn gateway_waits_for_api_key_concurrency_slot_then_executes_openai_respons
|
||||
upstream_handle.abort();
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn gateway_returns_concurrency_limited_after_wait_budget_expires_for_openai_responses_sync() {
|
||||
#[test]
|
||||
fn gateway_returns_concurrency_limited_after_wait_budget_expires_for_openai_responses_sync() {
|
||||
run_cli_sync_test(
|
||||
"gateway_returns_concurrency_limited_after_wait_budget_expires_for_openai_responses_sync",
|
||||
gateway_returns_concurrency_limited_after_wait_budget_expires_for_openai_responses_sync_impl,
|
||||
);
|
||||
}
|
||||
|
||||
async fn gateway_returns_concurrency_limited_after_wait_budget_expires_for_openai_responses_sync_impl(
|
||||
) {
|
||||
fn hash_api_key(value: &str) -> String {
|
||||
let mut hasher = Sha256::new();
|
||||
hasher.update(value.as_bytes());
|
||||
@@ -1278,8 +1325,15 @@ async fn gateway_returns_concurrency_limited_after_wait_budget_expires_for_opena
|
||||
upstream_handle.abort();
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn gateway_returns_openai_responses_error_for_local_sync_failure() {
|
||||
#[test]
|
||||
fn gateway_returns_openai_responses_error_for_local_sync_failure() {
|
||||
run_cli_sync_test(
|
||||
"gateway_returns_openai_responses_error_for_local_sync_failure",
|
||||
gateway_returns_openai_responses_error_for_local_sync_failure_impl,
|
||||
);
|
||||
}
|
||||
|
||||
async fn gateway_returns_openai_responses_error_for_local_sync_failure_impl() {
|
||||
fn hash_api_key(value: &str) -> String {
|
||||
let mut hasher = Sha256::new();
|
||||
hasher.update(value.as_bytes());
|
||||
@@ -1571,8 +1625,16 @@ async fn gateway_returns_openai_responses_error_for_local_sync_failure() {
|
||||
upstream_handle.abort();
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn gateway_returns_openai_responses_error_for_local_cross_format_gemini_cli_sync_failure() {
|
||||
#[test]
|
||||
fn gateway_returns_openai_responses_error_for_local_cross_format_gemini_cli_sync_failure() {
|
||||
run_cli_sync_test(
|
||||
"gateway_returns_openai_responses_error_for_local_cross_format_gemini_cli_sync_failure",
|
||||
gateway_returns_openai_responses_error_for_local_cross_format_gemini_cli_sync_failure_impl,
|
||||
);
|
||||
}
|
||||
|
||||
async fn gateway_returns_openai_responses_error_for_local_cross_format_gemini_cli_sync_failure_impl(
|
||||
) {
|
||||
#[derive(Debug, Clone)]
|
||||
struct SeenExecutionRuntimeSyncRequest {
|
||||
trace_id: String,
|
||||
@@ -1972,8 +2034,15 @@ async fn gateway_returns_openai_responses_error_for_local_cross_format_gemini_cl
|
||||
upstream_handle.abort();
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn gateway_returns_openai_responses_error_for_local_cross_format_claude_sync_failure() {
|
||||
#[test]
|
||||
fn gateway_returns_openai_responses_error_for_local_cross_format_claude_sync_failure() {
|
||||
run_cli_sync_test(
|
||||
"gateway_returns_openai_responses_error_for_local_cross_format_claude_sync_failure",
|
||||
gateway_returns_openai_responses_error_for_local_cross_format_claude_sync_failure_impl,
|
||||
);
|
||||
}
|
||||
|
||||
async fn gateway_returns_openai_responses_error_for_local_cross_format_claude_sync_failure_impl() {
|
||||
#[derive(Debug, Clone)]
|
||||
struct SeenExecutionRuntimeSyncRequest {
|
||||
trace_id: String,
|
||||
@@ -2349,8 +2418,16 @@ async fn gateway_returns_openai_responses_error_for_local_cross_format_claude_sy
|
||||
upstream_handle.abort();
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn gateway_returns_openai_responses_error_for_local_cross_format_claude_chat_sync_failure() {
|
||||
#[test]
|
||||
fn gateway_returns_openai_responses_error_for_local_cross_format_claude_chat_sync_failure() {
|
||||
run_cli_sync_test(
|
||||
"gateway_returns_openai_responses_error_for_local_cross_format_claude_chat_sync_failure",
|
||||
gateway_returns_openai_responses_error_for_local_cross_format_claude_chat_sync_failure_impl,
|
||||
);
|
||||
}
|
||||
|
||||
async fn gateway_returns_openai_responses_error_for_local_cross_format_claude_chat_sync_failure_impl(
|
||||
) {
|
||||
#[derive(Debug, Clone)]
|
||||
struct SeenExecutionRuntimeSyncRequest {
|
||||
trace_id: String,
|
||||
@@ -2729,8 +2806,16 @@ async fn gateway_returns_openai_responses_error_for_local_cross_format_claude_ch
|
||||
upstream_handle.abort();
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn gateway_returns_openai_responses_error_for_local_cross_format_gemini_chat_sync_failure() {
|
||||
#[test]
|
||||
fn gateway_returns_openai_responses_error_for_local_cross_format_gemini_chat_sync_failure() {
|
||||
run_cli_sync_test(
|
||||
"gateway_returns_openai_responses_error_for_local_cross_format_gemini_chat_sync_failure",
|
||||
gateway_returns_openai_responses_error_for_local_cross_format_gemini_chat_sync_failure_impl,
|
||||
);
|
||||
}
|
||||
|
||||
async fn gateway_returns_openai_responses_error_for_local_cross_format_gemini_chat_sync_failure_impl(
|
||||
) {
|
||||
#[derive(Debug, Clone)]
|
||||
struct SeenExecutionRuntimeSyncRequest {
|
||||
trace_id: String,
|
||||
@@ -3109,8 +3194,15 @@ async fn gateway_returns_openai_responses_error_for_local_cross_format_gemini_ch
|
||||
upstream_handle.abort();
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn gateway_executes_codex_cli_sync_via_local_decision_gate_after_oauth_refresh() {
|
||||
#[test]
|
||||
fn gateway_executes_codex_cli_sync_via_local_decision_gate_after_oauth_refresh() {
|
||||
run_cli_sync_test(
|
||||
"gateway_executes_codex_cli_sync_via_local_decision_gate_after_oauth_refresh",
|
||||
gateway_executes_codex_cli_sync_via_local_decision_gate_after_oauth_refresh_impl,
|
||||
);
|
||||
}
|
||||
|
||||
async fn gateway_executes_codex_cli_sync_via_local_decision_gate_after_oauth_refresh_impl() {
|
||||
#[derive(Debug, Clone)]
|
||||
struct SeenExecutionRuntimeSyncRequest {
|
||||
trace_id: String,
|
||||
|
||||
Reference in New Issue
Block a user