0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-02-02 04:38:21 -05:00

test(ext/ffi): Increase timeout value in event loop integration test callback (#18394)

This commit is contained in:
Aapo Alasuutari 2023-03-25 09:18:41 +02:00 committed by Matt Mastracci
parent 6374347f9a
commit 784914aa1d

View file

@ -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();