Skip to content

Commit 786e2b7

Browse files
committed
Fix enif_select 'stealing control' warning in asyncio tests
Add 50ms delay in end_per_testcase to allow async FD cleanup (enif_select STOP events) to complete before the next test starts. This prevents race conditions when the OS reuses FD numbers.
1 parent e8bb2ca commit 786e2b7

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

test/py_asyncio_compat_SUITE.erl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ init_per_testcase(_TestCase, Config) ->
130130
Config.
131131

132132
end_per_testcase(_TestCase, _Config) ->
133+
%% Allow time for async FD cleanup (enif_select STOP events)
134+
%% to complete before the next test starts. This prevents
135+
%% "stealing control" warnings when FDs are reused.
136+
timer:sleep(50),
133137
ok.
134138

135139
%% ============================================================================

0 commit comments

Comments
 (0)