Skip to content

Commit 9d59043

Browse files
committed
php#8: Add comprehensive bailout tests for TrueAsync API
This commit introduces 15 new tests that verify the robustness of the TrueAsync API when handling critical PHP failures (bailout scenarios). Test categories: - Memory exhaustion in simple and nested async operations - Stack overflow in simple and nested async operations - Bailout during suspend/resume operations - Bailout during await/awaitAll operations - Bailout with multiple concurrent coroutines - Bailout in shutdown functions - Bailout with onFinally handlers and exception handling These tests ensure that: - Memory and stack overflow are properly handled in async contexts - Graceful shutdown mode is correctly initiated during bailout - onFinally handlers execute properly even during critical failures - Resource cleanup mechanisms work correctly under extreme conditions - Exception handlers process composite exceptions from finally blocks All tests follow the established naming pattern (001-015) and include proper expectation handling for Fatal errors and graceful shutdown warnings.
1 parent ac1f0eb commit 9d59043

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Zend/zend_async_API.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,6 +1376,9 @@ END_EXTERN_C()
13761376
* @param priority Priority level for the exception-throwing coroutine
13771377
*/
13781378
#define ZEND_ASYNC_SPAWN_AND_THROW(exception, scope, priority) zend_async_spawn_and_throw_fn(exception, scope, priority)
1379+
/**
1380+
* The API method initiates graceful shutdown mode.
1381+
*/
13791382
#define ZEND_ASYNC_SHUTDOWN() zend_async_shutdown_fn()
13801383
#define ZEND_ASYNC_ENGINE_SHUTDOWN() zend_async_engine_shutdown_fn()
13811384
#define ZEND_ASYNC_GET_COROUTINES() zend_async_get_coroutines_fn()

0 commit comments

Comments
 (0)