From 3178eb1065f025ca446e87a28509245a0a953fbd Mon Sep 17 00:00:00 2001 From: Scott Prutton Date: Fri, 17 Jan 2025 12:48:12 -0500 Subject: [PATCH 1/2] fix: arm rootfs needs an arm linker --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index e67a36d1e4..7f0d9fe81e 100644 --- a/flake.nix +++ b/flake.nix @@ -235,6 +235,7 @@ # /lib64/ld-linux-x86-64.so.2 -> /nix/store/*/ld-linux-x86-64.20.2 mkdir -p $out/lib64 ln -sf ${pkgs.glibc}/lib/ld-linux-x86-64.so.2 $out/lib64/ld-linux-x86-64.so.2 + ln -sf ${pkgs.glibc}/lib/ld-linux-aarch64.so.1 $out/lib64/ld-linux-aarch64.so.1 wrapProgram $out/bin/lang-js \ --set LD_LIBRARY_PATH "${pkgs.lib.makeLibraryPath [ From 019d01be63abf80463eb2e15dd34ca18ea0b8d1e Mon Sep 17 00:00:00 2001 From: Scott Prutton Date: Fri, 17 Jan 2025 16:14:59 -0500 Subject: [PATCH 2/2] fix: add locking around transpilation --- bin/lang-js/package.json | 1 + bin/lang-js/src/function.ts | 26 +--- bin/lang-js/src/function_kinds/management.ts | 2 +- bin/lang-js/src/transpile.ts | 61 +++++++++ deno.lock | 16 +++ lib/cyclone-client/src/client.rs | 136 +++++++++++++------ lib/veritech-client/tests/integration.rs | 23 ++-- 7 files changed, 193 insertions(+), 72 deletions(-) create mode 100644 bin/lang-js/src/transpile.ts diff --git a/bin/lang-js/package.json b/bin/lang-js/package.json index b62e164b8f..93efe0c7b3 100644 --- a/bin/lang-js/package.json +++ b/bin/lang-js/package.json @@ -60,6 +60,7 @@ "joi": "^17.11.0", "js-yaml": "^4.1.0", "node-fetch": "^2", + "proper-lockfile": "^4.1.2", "toml": "^3.0.0", "typescript": "^4.9.5" }, diff --git a/bin/lang-js/src/function.ts b/bin/lang-js/src/function.ts index fb3d922761..31cf11852c 100644 --- a/bin/lang-js/src/function.ts +++ b/bin/lang-js/src/function.ts @@ -19,6 +19,7 @@ import { Debugger } from "./debug.ts"; import { transpile } from "jsr:@deno/emit"; import { Debug } from "./debug.ts"; import * as _worker from "./worker.js"; +import { bundleCode } from "./transpile.ts"; const debug = Debug("langJs:function"); @@ -264,28 +265,3 @@ export async function runCode( }; }); } - -async function bundleCode(code: string): Promise { - debug({ "code before bundle": code }); - const tempDir = await Deno.makeTempDir(); - const tempFile = `${tempDir}/script.ts`; - - await Deno.writeTextFile(tempFile, code); - const fileUrl = new URL(tempFile, import.meta.url); - - try { - const result = await transpile(fileUrl); - - const bundled = result.get(fileUrl.href) as string; - if (!bundled) { - throw new Error("Transpilation resulted in empty output"); - } - - debug({ "code after bundle": code }); - return bundled; - } catch (error) { - throw error; - } finally { - await Deno.remove(tempDir, { recursive: true }); - } -} diff --git a/bin/lang-js/src/function_kinds/management.ts b/bin/lang-js/src/function_kinds/management.ts index 7b83dafe57..f1bb67a6c5 100644 --- a/bin/lang-js/src/function_kinds/management.ts +++ b/bin/lang-js/src/function_kinds/management.ts @@ -44,7 +44,7 @@ export interface ManagementCreate { } export interface ManagementOperations { - create?: ManagementCreate, + create?: ManagementCreate; update?: { [key: string]: { properties?: object; diff --git a/bin/lang-js/src/transpile.ts b/bin/lang-js/src/transpile.ts new file mode 100644 index 0000000000..b57725551b --- /dev/null +++ b/bin/lang-js/src/transpile.ts @@ -0,0 +1,61 @@ +import * as _ from "npm:lodash-es"; +import { transpile } from "jsr:@deno/emit"; +import { Debug } from "./debug.ts"; +import { lock } from "npm:proper-lockfile"; + +const debug = Debug("langJs:transpile"); + +const LOCK_FILE = "/tmp/lang-js-transpile"; + +async function ensureLockfile() { + try { + await Deno.writeTextFile(LOCK_FILE, ""); + } catch (err) { + if (!(err instanceof Deno.errors.AlreadyExists)) { + throw err; + } + } +} + +export function bundleCode(code: string): Promise { + return (async () => { + let release; + + await ensureLockfile(); + + try { + release = await lock("/tmp/lang-js-transpile", { + stale: 30000, + updateInterval: 1000, + retries: { + retries: 60, + minTimeout: 100, + maxTimeout: 1000, + }, + }); + + debug({ "code before bundle": code }); + const tempDir = await Deno.makeTempDir(); + const tempFile = `${tempDir}/script.ts`; + + await Deno.writeTextFile(tempFile, code); + const fileUrl = new URL(tempFile, import.meta.url); + + try { + const result = await transpile(fileUrl); + const bundled = result.get(fileUrl.href) as string; + if (!bundled) { + throw new Error("Transpilation resulted in empty output"); + } + debug({ "code after bundle": bundled }); + return bundled; + } finally { + await Deno.remove(tempDir, { recursive: true }); + } + } finally { + if (release) { + await release(); + } + } + })(); +} diff --git a/deno.lock b/deno.lock index cb5c319221..bbf2661173 100644 --- a/deno.lock +++ b/deno.lock @@ -35,6 +35,7 @@ "npm:lodash-es@*": "4.17.21", "npm:lodash-es@^4.17.21": "4.17.21", "npm:node-fetch@2": "2.7.0", + "npm:proper-lockfile@^4.1.2": "4.1.2", "npm:toml@3": "3.0.0", "npm:tsup@^8.0.1": "8.3.5_typescript@4.9.5_esbuild@0.24.0", "npm:typedoc-plugin-markdown@^4.2.0": "4.3.1_typedoc@0.27.2__typescript@5.7.2", @@ -1100,6 +1101,9 @@ "type-fest" ] }, + "graceful-fs@4.2.11": { + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + }, "graphemer@1.4.0": { "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==" }, @@ -1582,6 +1586,14 @@ "react-is@18.3.1" ] }, + "proper-lockfile@4.1.2": { + "integrity": "sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA==", + "dependencies": [ + "graceful-fs", + "retry", + "signal-exit@3.0.7" + ] + }, "property-information@6.5.0": { "integrity": "sha512-PgTgs/BlvHxOu8QuEN7wi5A0OmXaBcHpmCSTehcs6Uuu9IkDIEo13Hy7n898RHfrQ49vKCoGeWZSaAK01nwVig==" }, @@ -1624,6 +1636,9 @@ "resolve-from@5.0.0": { "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==" }, + "retry@0.12.0": { + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==" + }, "reusify@1.0.4": { "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" }, @@ -2226,6 +2241,7 @@ "npm:joi@^17.11.0", "npm:js-yaml@^4.1.0", "npm:node-fetch@2", + "npm:proper-lockfile@^4.1.2", "npm:toml@3", "npm:tsup@^8.0.1", "npm:typedoc-plugin-markdown@^4.2.0", diff --git a/lib/cyclone-client/src/client.rs b/lib/cyclone-client/src/client.rs index f128ade87f..e7a8ff7f00 100644 --- a/lib/cyclone-client/src/client.rs +++ b/lib/cyclone-client/src/client.rs @@ -732,7 +732,7 @@ mod tests { } #[allow(clippy::disallowed_methods)] // `$RUST_LOG` is checked for in macro - #[test(tokio::test)] + #[test(tokio::test(flavor = "multi_thread", worker_threads = 1))] async fn http_execute_resolver() { let mut builder = Config::builder(); let mut client = http_client_for_running_server(builder.enable_resolver(true)).await; @@ -770,7 +770,7 @@ mod tests { // Start the protocol let mut progress = client - .prepare_execution(CycloneRequest::from_parts(req, Default::default())) + .prepare_execution(CycloneRequest::from_parts(req.clone(), Default::default())) .await .expect("failed to establish websocket stream") .start() @@ -784,7 +784,10 @@ mod tests { } Some(Ok(unexpected)) => panic!("unexpected msg kind: {unexpected:?}"), Some(Err(err)) => panic!("failed to receive 'i like' output: err={err:?}"), - None => panic!("output stream ended early"), + None => { + dbg!(req); + panic!("output stream ended early") + } }; match progress.next().await { Some(Ok(ProgressMessage::OutputStream(output))) => { @@ -792,7 +795,10 @@ mod tests { } Some(Ok(unexpected)) => panic!("unexpected msg kind: {unexpected:?}"), Some(Err(err)) => panic!("failed to receive 'i like' output: err={err:?}"), - None => panic!("output stream ended early"), + None => { + dbg!(req); + panic!("output stream ended early") + } }; loop { match progress.next().await { @@ -802,7 +808,10 @@ mod tests { } Some(Ok(ProgressMessage::Heartbeat)) => continue, Some(Err(err)) => panic!("failed to receive 'second' output: err={err:?}"), - None => panic!("output stream ended early"), + None => { + dbg!(req); + panic!("output stream ended early") + } }; } // TODO(fnichol): until we've determined how to handle processing the result server side, @@ -831,7 +840,7 @@ mod tests { } #[allow(clippy::disallowed_methods)] // `$RUST_LOG` is checked for in macro - #[test(tokio::test)] + #[test(tokio::test(flavor = "multi_thread", worker_threads = 1))] async fn uds_execute_resolver() { let tmp_socket = rand_uds(); let mut builder = Config::builder(); @@ -871,7 +880,7 @@ mod tests { // Start the protocol let mut progress = client - .prepare_execution(CycloneRequest::from_parts(req, Default::default())) + .prepare_execution(CycloneRequest::from_parts(req.clone(), Default::default())) .await .expect("failed to establish websocket stream") .start() @@ -885,7 +894,10 @@ mod tests { } Some(Ok(unexpected)) => panic!("unexpected msg kind: {unexpected:?}"), Some(Err(err)) => panic!("failed to receive 'i like' output: err={err:?}"), - None => panic!("output stream ended early"), + None => { + dbg!(req); + panic!("output stream ended early") + } }; match progress.next().await { Some(Ok(ProgressMessage::OutputStream(output))) => { @@ -893,7 +905,10 @@ mod tests { } Some(Ok(unexpected)) => panic!("unexpected msg kind: {unexpected:?}"), Some(Err(err)) => panic!("failed to receive 'i like' output: err={err:?}"), - None => panic!("output stream ended early"), + None => { + dbg!(req); + panic!("output stream ended early") + } }; loop { match progress.next().await { @@ -903,7 +918,10 @@ mod tests { } Some(Ok(ProgressMessage::Heartbeat)) => continue, Some(Err(err)) => panic!("failed to receive 'second' output: err={err:?}"), - None => panic!("output stream ended early"), + None => { + dbg!(req); + panic!("output stream ended early") + } }; } loop { @@ -972,7 +990,7 @@ mod tests { } #[allow(clippy::disallowed_methods)] // `$RUST_LOG` is checked for in macro - #[test(tokio::test)] + #[test(tokio::test(flavor = "multi_thread", worker_threads = 1))] async fn http_execute_validation() { let mut builder = Config::builder(); let client = http_client_for_running_server(builder.enable_validation(true)).await; @@ -981,7 +999,7 @@ mod tests { } #[allow(clippy::disallowed_methods)] // `$RUST_LOG` is checked for in macro - #[test(tokio::test)] + #[test(tokio::test(flavor = "multi_thread", worker_threads = 1))] async fn uds_execute_validation() { let tmp_socket = rand_uds(); let mut builder = Config::builder(); @@ -992,7 +1010,7 @@ mod tests { } #[allow(clippy::disallowed_methods)] // `$RUST_LOG` is checked for in macro - #[test(tokio::test)] + #[test(tokio::test(flavor = "multi_thread", worker_threads = 1))] async fn http_execute_action_run() { let mut builder = Config::builder(); let mut client = http_client_for_running_server(builder.enable_action_run(true)).await; @@ -1013,7 +1031,7 @@ mod tests { // Start the protocol let mut progress = client - .prepare_execution(CycloneRequest::from_parts(req, Default::default())) + .prepare_execution(CycloneRequest::from_parts(req.clone(), Default::default())) .await .expect("failed to establish websocket stream") .start() @@ -1029,7 +1047,10 @@ mod tests { } Some(Ok(ProgressMessage::Heartbeat)) => continue, Some(Err(err)) => panic!("failed to receive 'first' output: err={err:?}"), - None => panic!("output stream ended early"), + None => { + dbg!(req); + panic!("output stream ended early") + } }; } loop { @@ -1040,7 +1061,10 @@ mod tests { } Some(Ok(ProgressMessage::Heartbeat)) => continue, Some(Err(err)) => panic!("failed to receive 'second' output: err={err:?}"), - None => panic!("output stream ended early"), + None => { + dbg!(req); + panic!("output stream ended early") + } } } loop { @@ -1051,7 +1075,10 @@ mod tests { } Some(Ok(ProgressMessage::Heartbeat)) => continue, Some(Err(err)) => panic!("failed to receive Output: err={err:?}"), - None => panic!("output stream ended early"), + None => { + dbg!(req); + panic!("output stream ended early") + } }; } loop { @@ -1076,7 +1103,7 @@ mod tests { } #[allow(clippy::disallowed_methods)] // `$RUST_LOG` is checked for in macro - #[test(tokio::test)] + #[test(tokio::test(flavor = "multi_thread", worker_threads = 1))] async fn uds_execute_action_run() { let tmp_socket = rand_uds(); let mut builder = Config::builder(); @@ -1099,7 +1126,7 @@ mod tests { // Start the protocol let mut progress = client - .prepare_execution(CycloneRequest::from_parts(req, Default::default())) + .prepare_execution(CycloneRequest::from_parts(req.clone(), Default::default())) .await .expect("failed to establish websocket stream") .start() @@ -1115,7 +1142,10 @@ mod tests { } Some(Ok(ProgressMessage::Heartbeat)) => continue, Some(Err(err)) => panic!("failed to receive 'first' output: err={err:?}"), - None => panic!("output stream ended early"), + None => { + dbg!(req); + panic!("output stream ended early") + } }; } loop { @@ -1126,7 +1156,10 @@ mod tests { } Some(Ok(ProgressMessage::Heartbeat)) => continue, Some(Err(err)) => panic!("failed to receive 'second' output: err={err:?}"), - None => panic!("output stream ended early"), + None => { + dbg!(req); + panic!("output stream ended early") + } }; } loop { @@ -1137,7 +1170,10 @@ mod tests { } Some(Ok(ProgressMessage::Heartbeat)) => continue, Some(Err(err)) => panic!("failed to receive 'second' output: err={err:?}"), - None => panic!("output stream ended early"), + None => { + dbg!(req); + panic!("output stream ended early") + } }; } loop { @@ -1163,7 +1199,7 @@ mod tests { } #[allow(clippy::disallowed_methods)] // `$RUST_LOG` is checked for in macro - #[test(tokio::test)] + #[test(tokio::test(flavor = "multi_thread", worker_threads = 1))] async fn http_execute_schema_variant_definition() { let tmp_socket = rand_uds(); let mut builder = Config::builder(); @@ -1187,7 +1223,7 @@ mod tests { // Start the protocol let mut progress = client - .prepare_execution(CycloneRequest::from_parts(req, Default::default())) + .prepare_execution(CycloneRequest::from_parts(req.clone(), Default::default())) .await .expect("failed to establish websocket stream") .start() @@ -1203,7 +1239,10 @@ mod tests { } Some(Ok(ProgressMessage::Heartbeat)) => continue, Some(Err(err)) => panic!("failed to receive 'first' output: err={err:?}"), - None => panic!("output stream ended early"), + None => { + dbg!(req); + panic!("output stream ended early") + } }; } loop { @@ -1214,7 +1253,10 @@ mod tests { } Some(Ok(ProgressMessage::Heartbeat)) => continue, Some(Err(err)) => panic!("failed to receive 'second' output: err={err:?}"), - None => panic!("output stream ended early"), + None => { + dbg!(req); + panic!("output stream ended early") + } }; } loop { @@ -1240,7 +1282,7 @@ mod tests { } #[allow(clippy::disallowed_methods)] // `$RUST_LOG` is checked for in macro - #[test(tokio::test)] + #[test(tokio::test(flavor = "multi_thread", worker_threads = 1))] async fn uds_execute_schema_variant_definition() { let tmp_socket = rand_uds(); let mut builder = Config::builder(); @@ -1264,7 +1306,7 @@ mod tests { // Start the protocol let mut progress = client - .prepare_execution(CycloneRequest::from_parts(req, Default::default())) + .prepare_execution(CycloneRequest::from_parts(req.clone(), Default::default())) .await .expect("failed to establish websocket stream") .start() @@ -1280,7 +1322,10 @@ mod tests { } Some(Ok(ProgressMessage::Heartbeat)) => continue, Some(Err(err)) => panic!("failed to receive 'first' output: err={err:?}"), - None => panic!("output stream ended early"), + None => { + dbg!(req); + panic!("output stream ended early") + } }; } loop { @@ -1291,7 +1336,10 @@ mod tests { } Some(Ok(ProgressMessage::Heartbeat)) => continue, Some(Err(err)) => panic!("failed to receive 'second' output: err={err:?}"), - None => panic!("output stream ended early"), + None => { + dbg!(req); + panic!("output stream ended early") + } }; } loop { @@ -1317,7 +1365,7 @@ mod tests { } #[allow(clippy::disallowed_methods)] // `$RUST_LOG` is checked for in macro - #[test(tokio::test)] + #[test(tokio::test(flavor = "multi_thread", worker_threads = 1))] async fn http_execute_management_func() { let tmp_socket = rand_uds(); let mut builder = Config::builder(); @@ -1349,7 +1397,7 @@ mod tests { // Start the protocol let mut progress = client - .prepare_execution(CycloneRequest::from_parts(req, Default::default())) + .prepare_execution(CycloneRequest::from_parts(req.clone(), Default::default())) .await .expect("failed to establish websocket stream") .start() @@ -1365,7 +1413,10 @@ mod tests { } Some(Ok(ProgressMessage::Heartbeat)) => continue, Some(Err(err)) => panic!("failed to receive 'first' output: err={err:?}"), - None => panic!("output stream ended early"), + None => { + dbg!(req); + panic!("output stream ended early") + } }; } loop { @@ -1376,7 +1427,10 @@ mod tests { } Some(Ok(ProgressMessage::Heartbeat)) => continue, Some(Err(err)) => panic!("failed to receive 'second' output: err={err:?}"), - None => panic!("output stream ended early"), + None => { + dbg!(req); + panic!("output stream ended early") + } }; } loop { @@ -1402,7 +1456,7 @@ mod tests { } #[allow(clippy::disallowed_methods)] // `$RUST_LOG` is checked for in macro - #[test(tokio::test)] + #[test(tokio::test(flavor = "multi_thread", worker_threads = 1))] async fn uds_execute_management_func() { let tmp_socket = rand_uds(); let mut builder = Config::builder(); @@ -1434,7 +1488,7 @@ mod tests { // Start the protocol let mut progress = client - .prepare_execution(CycloneRequest::from_parts(req, Default::default())) + .prepare_execution(CycloneRequest::from_parts(req.clone(), Default::default())) .await .expect("failed to establish websocket stream") .start() @@ -1450,7 +1504,10 @@ mod tests { } Some(Ok(ProgressMessage::Heartbeat)) => continue, Some(Err(err)) => panic!("failed to receive 'first' output: err={err:?}"), - None => panic!("output stream ended early"), + None => { + dbg!(req); + panic!("output stream ended early") + } }; } loop { @@ -1461,7 +1518,10 @@ mod tests { } Some(Ok(ProgressMessage::Heartbeat)) => continue, Some(Err(err)) => panic!("failed to receive 'second' output: err={err:?}"), - None => panic!("output stream ended early"), + None => { + dbg!(req); + panic!("output stream ended early") + } }; } loop { diff --git a/lib/veritech-client/tests/integration.rs b/lib/veritech-client/tests/integration.rs index 50979b13b6..06ede54b54 100644 --- a/lib/veritech-client/tests/integration.rs +++ b/lib/veritech-client/tests/integration.rs @@ -88,7 +88,7 @@ fn base64_encode(input: impl AsRef<[u8]>) -> String { } #[allow(clippy::disallowed_methods)] // `$RUST_LOG` is checked for in macro -#[test(tokio::test)] +#[test(tokio::test(flavor = "multi_thread", worker_threads = 1))] async fn executes_simple_management_function() { let prefix = nats_prefix(); run_veritech_server_for_uds_cyclone(prefix.clone()).await; @@ -113,8 +113,8 @@ async fn executes_simple_management_function() { }, components: HashMap::new(), code_base64: base64_encode( - "function numberOfInputs({ thisComponent }) { - const number = Object.keys(thisComponent.properties)?.length; + "function numberOfInputs({ thisComponent }) { + const number = Object.keys(thisComponent.properties)?.length; return { status: 'ok', message: `${number}` } }", ), @@ -131,13 +131,14 @@ async fn executes_simple_management_function() { assert_eq!(Some("3"), success.message.as_deref()) } FunctionResult::Failure(failure) => { + dbg!("Request details: {:?}", request); panic!("function did not succeed and should have: {failure:?}") } } } #[allow(clippy::disallowed_methods)] // `$RUST_LOG` is checked for in macro -#[test(tokio::test)] +#[test(tokio::test(flavor = "multi_thread", worker_threads = 1))] async fn executes_simple_action_run() { let prefix = nats_prefix(); run_veritech_server_for_uds_cyclone(prefix.clone()).await; @@ -172,13 +173,14 @@ async fn executes_simple_action_run() { assert_eq!(success.status, ResourceStatus::Ok); } FunctionResult::Failure(failure) => { + dbg!("Request details: {:?}", request); panic!("function did not succeed and should have: {failure:?}") } } } #[allow(clippy::disallowed_methods)] // `$RUST_LOG` is checked for in macro -#[test(tokio::test)] +#[test(tokio::test(flavor = "multi_thread", worker_threads = 1))] async fn executes_simple_resolver_function() { let prefix = nats_prefix(); run_veritech_server_for_uds_cyclone(prefix.clone()).await; @@ -221,13 +223,14 @@ async fn executes_simple_resolver_function() { assert!(!success.unset); } FunctionResult::Failure(failure) => { + dbg!("Request details: {:?}", request); panic!("function did not succeed and should have: {failure:?}") } } } #[allow(clippy::disallowed_methods)] // `$RUST_LOG` is checked for in macro -#[test(tokio::test)] +#[test(tokio::test(flavor = "multi_thread", worker_threads = 1))] async fn type_checks_resolve_function() { let prefix = nats_prefix(); run_veritech_server_for_uds_cyclone(prefix.clone()).await; @@ -290,10 +293,12 @@ async fn type_checks_resolve_function() { let value = inner.get("value").expect("value should exist").clone(); assert_eq!(value, success.data); } else { + dbg!("Request details: {:?}", request); panic!("no value in return data :(") } } FunctionResult::Failure(_) => { + dbg!("Request details: {:?}", request); panic!("should have failed :("); } } @@ -363,7 +368,7 @@ async fn type_checks_resolve_function() { } #[allow(clippy::disallowed_methods)] // `$RUST_LOG` is checked for in macro -#[test(tokio::test)] +#[test(tokio::test(flavor = "multi_thread", worker_threads = 1))] async fn executes_simple_validation() { let prefix = nats_prefix(); run_veritech_server_for_uds_cyclone(prefix.clone()).await; @@ -397,13 +402,14 @@ async fn executes_simple_validation() { assert!(success.error.is_none()); } FunctionResult::Failure(failure) => { + dbg!("Request details: {:?}", request); panic!("function did not succeed and should have: {failure:?}") } } } #[allow(clippy::disallowed_methods)] // `$RUST_LOG` is checked for in macro -#[test(tokio::test)] +#[test(tokio::test(flavor = "multi_thread", worker_threads = 1))] async fn executes_simple_schema_variant_definition() { let prefix = nats_prefix(); run_veritech_server_for_uds_cyclone(prefix.clone()).await; @@ -451,6 +457,7 @@ async fn executes_simple_schema_variant_definition() { ); } FunctionResult::Failure(failure) => { + dbg!("Request details: {:?}", request); panic!("function did not succeed and should have: {failure:?}") } }