summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test_ffi/tests/event_loop_integration.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/test_ffi/tests/event_loop_integration.ts b/test_ffi/tests/event_loop_integration.ts
index 55dc563bb..593841948 100644
--- a/test_ffi/tests/event_loop_integration.ts
+++ b/test_ffi/tests/event_loop_integration.ts
@@ -44,7 +44,7 @@ const tripleLogCallback = () => {
callback.ref();
dylib.symbols.call_stored_function_thread_safe_and_log();
}
- }, 10);
+ }, 100);
};
const callback = Deno.UnsafeCallback.threadSafe(
@@ -60,11 +60,12 @@ dylib.symbols.store_function(callback.pointer);
// Synchronous callback logging
console.log("SYNCHRONOUS");
+// This function only calls the callback, and does not log.
dylib.symbols.call_stored_function();
console.log("STORED_FUNCTION called");
// Wait to make sure synch logging and async logging
-await new Promise((res) => setTimeout(res, 100));
+await new Promise((res) => setTimeout(res, 200));
// Ref once to make sure both `queueMicrotask()` and `setTimeout()`
// must resolve and unref before isolate exists.
@@ -73,4 +74,5 @@ callback.ref();
console.log("THREAD SAFE");
retry = true;
+// This function calls the callback and logs 'STORED_FUNCTION called'
dylib.symbols.call_stored_function_thread_safe_and_log();