Skip to content

Commit 84b8c43

Browse files
committed
test: add cleanup delay to prevent orphan QUIC process crashes
Add timer:sleep(100) in cleanup functions to allow late UDP packets to be processed before test processes exit. This prevents EUnit from detecting orphan process crashes and marking tests as cancelled.
1 parent da2c6b1 commit 84b8c43

8 files changed

Lines changed: 16 additions & 0 deletions

test/hackney_conn_http3_tests.erl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ setup() ->
2121

2222
cleanup(_) ->
2323
hackney_conn_sup:stop_all(),
24+
%% Allow time for late UDP packets to be processed
25+
timer:sleep(100),
2426
ok.
2527

2628
%%====================================================================

test/hackney_h3_integration_tests.erl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ setup() ->
2929

3030
cleanup(_) ->
3131
hackney_conn_sup:stop_all(),
32+
%% Allow time for late UDP packets to be processed
33+
timer:sleep(100),
3234
ok.
3335

3436
%%====================================================================

test/hackney_h3_redirect_tests.erl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ setup() ->
3232

3333
cleanup(_) ->
3434
hackney_conn_sup:stop_all(),
35+
%% Allow time for late UDP packets to be processed
36+
timer:sleep(100),
3537
ok.
3638

3739
%%====================================================================

test/hackney_http3_integration_tests.erl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ setup() ->
2323
cleanup(_) ->
2424
hackney_conn_sup:stop_all(),
2525
hackney_altsvc:clear_all(),
26+
%% Allow time for late UDP packets to be processed
27+
timer:sleep(100),
2628
ok.
2729

2830
%%====================================================================

test/hackney_http3_streaming_tests.erl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ setup() ->
2323
cleanup(_) ->
2424
hackney_conn_sup:stop_all(),
2525
hackney_altsvc:clear_all(),
26+
%% Allow time for late UDP packets to be processed
27+
timer:sleep(100),
2628
ok.
2729

2830
%%====================================================================

test/hackney_http3_tests.erl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ setup() ->
2323

2424
cleanup(_) ->
2525
hackney_conn_sup:stop_all(),
26+
%% Allow time for late UDP packets to be processed
27+
timer:sleep(100),
2628
ok.
2729

2830
%%====================================================================

test/hackney_pool_h3_tests.erl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ setup() ->
2121

2222
cleanup(_) ->
2323
hackney_conn_sup:stop_all(),
24+
%% Allow time for late UDP packets to be processed
25+
timer:sleep(100),
2426
ok.
2527

2628
%%====================================================================

test/hackney_quic_tests.erl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ setup() ->
2222

2323
cleanup(_) ->
2424
hackney_conn_sup:stop_all(),
25+
%% Allow time for late UDP packets to be processed
26+
timer:sleep(100),
2527
ok.
2628

2729
%%====================================================================

0 commit comments

Comments
 (0)