Skip to content

Commit

Permalink
Bump timeout for waiting for server events in tests
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jcpetruzza authored and facebook-github-bot committed Jan 10, 2025
1 parent db6a761 commit 965219f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/edb_dap_test_client.erl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ initialize(Client, Args) ->

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

-spec launch(client(), edb_dap:launch_request_arguments()) -> ok.
launch(Client, Args) ->
Expand Down

0 comments on commit 965219f

Please sign in to comment.