mirror of
https://github.com/apple/swift-nio
synced 2026-11-28 05:14:23 +00:00
### Motivation: The two testing event loops—`EmbeddedEventLoop` and `NIOAsyncTestingEventLoop`—have different semantics for outstanding work during shutdown, which are both different from the production `SelectableEventLoop`, specifically with newly scheduled tasks that result from running existing scheduled work at the time of shutdown. There are three axes to consider: 1. Scheduled tasks that are at or past their deadline. 2. Scheduled tasks with a deadline in the future. 3. Newly scheduled work that result from either running or cancelling (1) and (2). | | (1) | (2) | (3) | |-|-|-|-| | `SelectableEventLoop` | Run | Cancel | Quiesce over 1000 ticks, repeatedly run resulting (1) and cancel resulting (2) | | `EmbeddedEventLoop` | Run | Cancel | Cancel resulting (1) and resulting (2) | | `NIOAsyncTestingEventLoop` | Run | Run | Run resulting (1) and resulting (2) | Note that `NIOAsyncTestingEventLoop` may never terminate because of this. ### Modifications: This PR aligns `EmbeddedEventLoop` and `NIOTestingEventLoop` and makes them more similar to `SelectableEventLoop` and less surprising semantics. ### Result: | | (1) | (2) | (3) | |-|-|-|-| | `SelectableEventLoop` | Run | Cancel | Quiesce over 1000 ticks, repeatedly run resulting (1) and cancel resulting (2) | | `EmbeddedEventLoop` | Run | Cancel | Cancel resulting (1) and resulting (2) | | `NIOAsyncTestingEventLoop` | Run | Cancel | Cancel resulting (1) and resulting (2) | ### Future work: Given both the `EmbeddedEventLoop` and `NIOAsyncTestingEventLoop` are used in tests of NIO applications that run with `SelectableEventLoop` in production, it might be worth extending both to also support quiescing to give a more representative shutdown behaviour in tests.
51 lines
2.1 KiB
JSON
51 lines
2.1 KiB
JSON
{
|
|
"10000000_asyncsequenceproducer": 20,
|
|
"1000000_asyncwriter": 1000015,
|
|
"1000_addHandlers": 43000,
|
|
"1000_addHandlers_sync": 36000,
|
|
"1000_addRemoveHandlers_handlercontext": 8032,
|
|
"1000_addRemoveHandlers_handlername": 8032,
|
|
"1000_addRemoveHandlers_handlertype": 8032,
|
|
"1000_autoReadGetAndSet": 18000,
|
|
"1000_autoReadGetAndSet_sync": 0,
|
|
"1000_copying_bytebufferview_to_array": 1000,
|
|
"1000_copying_circularbuffer_to_array": 1000,
|
|
"1000_getHandlers": 8034,
|
|
"1000_getHandlers_sync": 34,
|
|
"1000_reqs_1_conn": 26372,
|
|
"1000_rst_connections": 147004,
|
|
"1000_tcpbootstraps": 4001,
|
|
"1000_tcpconnections": 154002,
|
|
"1000_udp_reqs": 6014,
|
|
"1000_udpbootstraps": 2000,
|
|
"1000_udpconnections": 75008,
|
|
"1_reqs_1000_conn": 398000,
|
|
"bytebuffer_lots_of_rw": 2005,
|
|
"creating_10000_headers": 0,
|
|
"decode_1000_ws_frames": 2000,
|
|
"encode_1000_ws_frames_holding_buffer": 3,
|
|
"encode_1000_ws_frames_holding_buffer_with_mask": 2003,
|
|
"encode_1000_ws_frames_holding_buffer_with_space": 3,
|
|
"encode_1000_ws_frames_holding_buffer_with_space_with_mask": 2003,
|
|
"encode_1000_ws_frames_new_buffer": 3000,
|
|
"encode_1000_ws_frames_new_buffer_with_mask": 5000,
|
|
"encode_1000_ws_frames_new_buffer_with_space": 3000,
|
|
"encode_1000_ws_frames_new_buffer_with_space_with_mask": 5000,
|
|
"execute_hop_10000_tasks": 0,
|
|
"future_erase_result": 4001,
|
|
"future_lots_of_callbacks": 53001,
|
|
"get_100000_headers_canonical_form": 700000,
|
|
"get_100000_headers_canonical_form_trimming_whitespace": 700000,
|
|
"get_100000_headers_canonical_form_trimming_whitespace_from_long_string": 700000,
|
|
"get_100000_headers_canonical_form_trimming_whitespace_from_short_string": 700000,
|
|
"modifying_1000_circular_buffer_elements": 0,
|
|
"modifying_byte_buffer_view": 6000,
|
|
"ping_pong_1000_reqs_1_conn": 334,
|
|
"read_10000_chunks_from_file": 110009,
|
|
"schedule_10000_tasks": 40084,
|
|
"schedule_and_run_10000_tasks": 50010,
|
|
"scheduling_10000_executions": 89,
|
|
"udp_1000_reqs_1_conn": 6156,
|
|
"udp_1_reqs_1000_conn": 162000
|
|
}
|