mirror of
https://github.com/uselessd/alcove.git
synced 2026-04-15 09:15:19 +00:00
test: fix race condition on exit
Since exit_status is now enabled by default, a test would occasionally fail depending on how quickly the message was received from the port. Fix by waiting for the exit_status event to be received.
This commit is contained in:
@@ -211,12 +211,12 @@ setopt(#state{pid = Drv}) ->
|
||||
event(#state{pid = Drv}) ->
|
||||
{ok, Fork} = alcove:fork(Drv),
|
||||
Reply0 = alcove:exit(Drv, [Fork], 0),
|
||||
Reply1 = alcove:event(Drv, [Fork]),
|
||||
Reply1 = alcove:event(Drv, [Fork], 5000),
|
||||
Reply2 = alcove:event(Drv, [], 5000),
|
||||
|
||||
[
|
||||
?_assertEqual(ok, Reply0),
|
||||
?_assertEqual(false, Reply1),
|
||||
?_assertEqual({exit_status,0}, Reply1),
|
||||
?_assertMatch({signal,_}, Reply2)
|
||||
].
|
||||
|
||||
|
||||
Reference in New Issue
Block a user