Skip to content

Commit 965219f

Browse files
jcpetruzzafacebook-github-bot
authored andcommitted
Bump timeout for waiting for server events in tests
Summary: # Context We use the edb_dap_test_client when writing tests for the DAP server. In particular, it has a `wait_for_event()` function that we use to block until certain event is received from the server # Problem In rare cases, this may take more than the default gen_server timeout of 5s which leads to spurious failures. ``` ✗ Fail: erl/util/edb:edb_dap_steps_SUITE - .test_next_works (6.3s) Details: exception error: {timeout,{gen_server,call, [<0.312.0>, {'$wait_for_event',<<"stopped">>}]}} StdOut: Testing __edb_dap_steps_SUITE__.edb_dap_steps_SUITE.edb_dap_steps_SUITE.cases: *** FAILED test case 1 of 3 *** ``` # This diff While in the future it could make sense to add a version of this function where the timeout is configurable, for now we bump the default timeout to 10s Reviewed By: acw224 Differential Revision: D67980572 fbshipit-source-id: f24c8142644b3f2574e5f60e92f4133d6a823232
1 parent db6a761 commit 965219f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/edb_dap_test_client.erl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ initialize(Client, Args) ->
7373

7474
-spec wait_for_event(edb_dap:event_type(), client()) -> ok.
7575
wait_for_event(Type, Client) ->
76-
gen_server:call(Client, {'$wait_for_event', Type}).
76+
WaitTimeoutSecs = 10_000,
77+
gen_server:call(Client, {'$wait_for_event', Type}, WaitTimeoutSecs).
7778

7879
-spec launch(client(), edb_dap:launch_request_arguments()) -> ok.
7980
launch(Client, Args) ->

0 commit comments

Comments
 (0)