mirror of
https://github.com/apple/swift-nio
synced 2026-11-25 04:47:49 +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.
92 lines
3.8 KiB
YAML
92 lines
3.8 KiB
YAML
version: "3"
|
|
|
|
services:
|
|
|
|
runtime-setup:
|
|
image: swift-nio:22.04-main
|
|
build:
|
|
args:
|
|
base_image: "swiftlang/swift:nightly-main-jammy"
|
|
|
|
unit-tests:
|
|
image: swift-nio:22.04-main
|
|
|
|
integration-tests:
|
|
image: swift-nio:22.04-main
|
|
|
|
documentation-check:
|
|
image: swift-nio:22.04-main
|
|
|
|
test:
|
|
image: swift-nio:22.04-main
|
|
environment:
|
|
- SWIFT_VERSION=nightly-main
|
|
- MAX_ALLOCS_ALLOWED_10000000_asyncsequenceproducer=19
|
|
- MAX_ALLOCS_ALLOWED_1000000_asyncwriter=1000050
|
|
- MAX_ALLOCS_ALLOWED_1000_addHandlers=43050
|
|
- MAX_ALLOCS_ALLOWED_1000_addHandlers_sync=36050
|
|
- MAX_ALLOCS_ALLOWED_1000_addRemoveHandlers_handlercontext=8050
|
|
- MAX_ALLOCS_ALLOWED_1000_addRemoveHandlers_handlername=8050
|
|
- MAX_ALLOCS_ALLOWED_1000_addRemoveHandlers_handlertype=8050
|
|
- MAX_ALLOCS_ALLOWED_1000_autoReadGetAndSet=18050
|
|
- MAX_ALLOCS_ALLOWED_1000_autoReadGetAndSet_sync=0
|
|
- MAX_ALLOCS_ALLOWED_1000_copying_bytebufferview_to_array=1050
|
|
- MAX_ALLOCS_ALLOWED_1000_copying_circularbuffer_to_array=1050
|
|
- MAX_ALLOCS_ALLOWED_1000_getHandlers=8050
|
|
- MAX_ALLOCS_ALLOWED_1000_getHandlers_sync=34
|
|
- MAX_ALLOCS_ALLOWED_1000_reqs_1_conn=26400
|
|
- MAX_ALLOCS_ALLOWED_1000_rst_connections=145050
|
|
- MAX_ALLOCS_ALLOWED_1000_tcpbootstraps=3050
|
|
- MAX_ALLOCS_ALLOWED_1000_tcpconnections=152050
|
|
- MAX_ALLOCS_ALLOWED_1000_udp_reqs=6050
|
|
- MAX_ALLOCS_ALLOWED_1000_udpbootstraps=2050
|
|
- MAX_ALLOCS_ALLOWED_1000_udpconnections=75050
|
|
- MAX_ALLOCS_ALLOWED_1_reqs_1000_conn=389050
|
|
- MAX_ALLOCS_ALLOWED_bytebuffer_lots_of_rw=2050
|
|
- MAX_ALLOCS_ALLOWED_creating_10000_headers=0
|
|
- MAX_ALLOCS_ALLOWED_decode_1000_ws_frames=2050
|
|
- MAX_ALLOCS_ALLOWED_encode_1000_ws_frames_holding_buffer=3
|
|
- MAX_ALLOCS_ALLOWED_encode_1000_ws_frames_holding_buffer_with_mask=2050
|
|
- MAX_ALLOCS_ALLOWED_encode_1000_ws_frames_holding_buffer_with_space=3
|
|
- MAX_ALLOCS_ALLOWED_encode_1000_ws_frames_holding_buffer_with_space_with_mask=2050
|
|
- MAX_ALLOCS_ALLOWED_encode_1000_ws_frames_new_buffer=3050
|
|
- MAX_ALLOCS_ALLOWED_encode_1000_ws_frames_new_buffer_with_mask=5050
|
|
- MAX_ALLOCS_ALLOWED_encode_1000_ws_frames_new_buffer_with_space=3050
|
|
- MAX_ALLOCS_ALLOWED_encode_1000_ws_frames_new_buffer_with_space_with_mask=5050
|
|
- MAX_ALLOCS_ALLOWED_execute_hop_10000_tasks=0
|
|
- MAX_ALLOCS_ALLOWED_future_erase_result=4050
|
|
- MAX_ALLOCS_ALLOWED_future_lots_of_callbacks=53050
|
|
- MAX_ALLOCS_ALLOWED_get_100000_headers_canonical_form=700050
|
|
- MAX_ALLOCS_ALLOWED_get_100000_headers_canonical_form_trimming_whitespace=700050
|
|
- MAX_ALLOCS_ALLOWED_get_100000_headers_canonical_form_trimming_whitespace_from_long_string=700050
|
|
- MAX_ALLOCS_ALLOWED_get_100000_headers_canonical_form_trimming_whitespace_from_short_string=700050
|
|
- MAX_ALLOCS_ALLOWED_modifying_1000_circular_buffer_elements=0
|
|
- MAX_ALLOCS_ALLOWED_modifying_byte_buffer_view=6050
|
|
- MAX_ALLOCS_ALLOWED_ping_pong_1000_reqs_1_conn=319
|
|
- MAX_ALLOCS_ALLOWED_read_10000_chunks_from_file=110050
|
|
- MAX_ALLOCS_ALLOWED_schedule_10000_tasks=40100
|
|
- MAX_ALLOCS_ALLOWED_schedule_and_run_10000_tasks=50050
|
|
- MAX_ALLOCS_ALLOWED_scheduling_10000_executions=89
|
|
- MAX_ALLOCS_ALLOWED_udp_1000_reqs_1_conn=6200
|
|
- MAX_ALLOCS_ALLOWED_udp_1_reqs_1000_conn=162050
|
|
- WARN_AS_ERROR_ARG=-Xswiftc -warnings-as-errors
|
|
- IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error
|
|
# - SANITIZER_ARG=--sanitize=thread # TSan broken still
|
|
|
|
performance-test:
|
|
image: swift-nio:22.04-main
|
|
|
|
update-benchmark-baseline:
|
|
image: swift-nio:22.04-main
|
|
environment:
|
|
- SWIFT_VERSION=nightly-main
|
|
|
|
shell:
|
|
image: swift-nio:22.04-main
|
|
|
|
echo:
|
|
image: swift-nio:22.04-main
|
|
|
|
http:
|
|
image: swift-nio:22.04-main
|