Skip to content

Commit 421327d

Browse files
committed
attempt to fix race conditions in dap tests
1 parent 6a8d5bb commit 421327d

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

apps/debug_adapter/test/debugger_test.exs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,6 +1228,8 @@ defmodule ElixirLS.DebugAdapter.ServerTest do
12281228
assert_receive(response(_, 2, "launch", _), 3000)
12291229
assert_receive(event(_, "initialized", %{}), 5000)
12301230

1231+
Process.sleep(100)
1232+
12311233
refute :hello in :int.interpreted()
12321234
abs_path = Path.absname("src/hello.erl")
12331235

@@ -1241,6 +1243,8 @@ defmodule ElixirLS.DebugAdapter.ServerTest do
12411243
5000
12421244
)
12431245

1246+
Process.sleep(100)
1247+
12441248
assert :hello in :int.interpreted()
12451249
assert [{{:hello, 5}, [:active, :enable, :null, _]}] = :int.all_breaks(:hello)
12461250
assert %{^abs_path => [{[:hello], 5}]} = :sys.get_state(server).breakpoints
@@ -1310,6 +1314,8 @@ defmodule ElixirLS.DebugAdapter.ServerTest do
13101314
assert_receive(response(_, 2, "launch", _), 3000)
13111315
assert_receive(event(_, "initialized", %{}), 5000)
13121316

1317+
Process.sleep(100)
1318+
13131319
refute :hello in :int.interpreted()
13141320
abs_path = Path.absname("src/hello.erl1")
13151321

@@ -1358,6 +1364,8 @@ defmodule ElixirLS.DebugAdapter.ServerTest do
13581364
assert_receive(response(_, 2, "launch", _), 3000)
13591365
assert_receive(event(_, "initialized", %{}), 5000)
13601366

1367+
Process.sleep(100)
1368+
13611369
refute MixProject in :int.interpreted()
13621370
refute MixProject.Some in :int.interpreted()
13631371
abs_path = Path.absname("lib/mix_project.ex")
@@ -1462,6 +1470,8 @@ defmodule ElixirLS.DebugAdapter.ServerTest do
14621470
assert_receive(response(_, 2, "launch", _), 3000)
14631471
assert_receive(event(_, "initialized", %{}), 5000)
14641472

1473+
Process.sleep(100)
1474+
14651475
refute MixProject in :int.interpreted()
14661476
refute :hello in :int.interpreted()
14671477

@@ -1498,6 +1508,8 @@ defmodule ElixirLS.DebugAdapter.ServerTest do
14981508
5000
14991509
)
15001510

1511+
Process.sleep(100)
1512+
15011513
assert :hello in :int.interpreted()
15021514
assert [{{:hello, 5}, _}] = :int.all_breaks(:hello)
15031515

@@ -1554,6 +1566,8 @@ defmodule ElixirLS.DebugAdapter.ServerTest do
15541566
assert_receive(response(_, 2, "launch", _), 3000)
15551567
assert_receive(event(_, "initialized", %{}), 5000)
15561568

1569+
Process.sleep(100)
1570+
15571571
refute MixProject in :int.interpreted()
15581572

15591573
# set
@@ -1649,6 +1663,8 @@ defmodule ElixirLS.DebugAdapter.ServerTest do
16491663
assert_receive(response(_, 2, "launch", _), 3000)
16501664
assert_receive(event(_, "initialized", %{}), 5000)
16511665

1666+
Process.sleep(100)
1667+
16521668
refute MixProject in :int.interpreted()
16531669

16541670
# set
@@ -1744,6 +1760,8 @@ defmodule ElixirLS.DebugAdapter.ServerTest do
17441760
assert_receive(response(_, 2, "launch", _), 3000)
17451761
assert_receive(event(_, "initialized", %{}), 5000)
17461762

1763+
Process.sleep(100)
1764+
17471765
refute MixProject in :int.interpreted()
17481766

17491767
# set
@@ -2066,6 +2084,8 @@ defmodule ElixirLS.DebugAdapter.ServerTest do
20662084
assert_receive(response(_, 2, "launch", _), 3000)
20672085
assert_receive(event(_, "initialized", %{}), 5000)
20682086

2087+
Process.sleep(100)
2088+
20692089
refute :hello in :int.interpreted()
20702090

20712091
Server.receive_packet(
@@ -2140,6 +2160,8 @@ defmodule ElixirLS.DebugAdapter.ServerTest do
21402160
assert_receive(response(_, 2, "launch", _), 3000)
21412161
assert_receive(event(_, "initialized", %{}), 5000)
21422162

2163+
Process.sleep(100)
2164+
21432165
refute :hello in :int.interpreted()
21442166

21452167
Server.receive_packet(
@@ -2184,6 +2206,8 @@ defmodule ElixirLS.DebugAdapter.ServerTest do
21842206
assert_receive(response(_, 2, "launch", _), 3000)
21852207
assert_receive(event(_, "initialized", %{}), 5000)
21862208

2209+
Process.sleep(100)
2210+
21872211
refute :hello in :int.interpreted()
21882212

21892213
# set
@@ -2277,6 +2301,8 @@ defmodule ElixirLS.DebugAdapter.ServerTest do
22772301
assert_receive(response(_, 2, "launch", _), 3000)
22782302
assert_receive(event(_, "initialized", %{}), 5000)
22792303

2304+
Process.sleep(100)
2305+
22802306
refute :hello in :int.interpreted()
22812307

22822308
# set
@@ -2708,6 +2734,8 @@ defmodule ElixirLS.DebugAdapter.ServerTest do
27082734
assert_receive(response(_, 2, "launch", _), 3000)
27092735
assert_receive(event(_, "initialized", %{}), 5000)
27102736

2737+
Process.sleep(100)
2738+
27112739
assert MixProject.Dbg in :int.interpreted()
27122740

27132741
Server.receive_packet(server, request(5, "configurationDone", %{}))
@@ -2894,6 +2922,8 @@ defmodule ElixirLS.DebugAdapter.ServerTest do
28942922
assert_receive(response(_, 2, "launch", _), 3000)
28952923
assert_receive(event(_, "initialized", %{}), 5000)
28962924

2925+
Process.sleep(100)
2926+
28972927
assert MixProject.Dbg in :int.interpreted()
28982928

28992929
Server.receive_packet(server, request(5, "configurationDone", %{}))
@@ -3062,6 +3092,8 @@ defmodule ElixirLS.DebugAdapter.ServerTest do
30623092
assert_receive(response(_, 2, "launch", _), 3000)
30633093
assert_receive(event(_, "initialized", %{}), 5000)
30643094

3095+
Process.sleep(100)
3096+
30653097
refute MixProject.Dbg in :int.interpreted()
30663098

30673099
Server.receive_packet(server, request(5, "configurationDone", %{}))

0 commit comments

Comments
 (0)