|
17 | 17 | connection = worker.connect |
18 | 18 |
|
19 | 19 | # Wait for the client to connect to the server: |
20 | | - sleep(0.001) until registration_monitor.registrations.any? |
| 20 | + event = registration_monitor.pop |
| 21 | + connection = event.connection |
21 | 22 |
|
22 | | - connection = registration_monitor.registrations.first |
23 | 23 | expect(connection.state).to have_keys( |
24 | 24 | process_id: be == ::Process.pid |
25 | 25 | ) |
|
32 | 32 | worker = Async::Container::Supervisor::Worker.new(state, endpoint: endpoint) |
33 | 33 | worker_task = worker.run |
34 | 34 |
|
35 | | - sleep(0.001) until registration_monitor.registrations.any? |
| 35 | + event = registration_monitor.pop |
| 36 | + connection = event.connection |
36 | 37 |
|
37 | 38 | path = File.join(@root, "memory.json") |
38 | | - connection = registration_monitor.registrations.first |
39 | 39 | connection.call(do: :memory_dump, path: path) |
40 | 40 |
|
41 | 41 | expect(File.size(path)).to be > 0 |
@@ -110,9 +110,8 @@ def reader_target.dispatch(call); end |
110 | 110 | worker = Async::Container::Supervisor::Worker.new(state, endpoint: endpoint) |
111 | 111 | worker_task = worker.run |
112 | 112 |
|
113 | | - sleep(0.001) until registration_monitor.registrations.any? |
114 | | - |
115 | | - connection = registration_monitor.registrations.first |
| 113 | + event = registration_monitor.pop |
| 114 | + connection = event.connection |
116 | 115 |
|
117 | 116 | # Sample for a short duration (1 second for test speed) |
118 | 117 | result = connection.call(do: :memory_sample, duration: 1) |
|
0 commit comments