Commit 4d0ce49
committed
✅ Add mutex to FakeServer::Connection#close
I believe this was getting triggered from multiple threads:
* from `FakeServer#shutdown` (which already has a mutex of its own)
* called in ensure clause in `FakeServer#run` (from the server thread)
* called directly by the tests (from the main thread)
* from the ensure clause in `Connection#run` (runs in the server thread)
So the main thread could call `FakeServer#shutdown` while the server
thread is handling the ensure clause in `Connection#run`. Adding a
mutex to `Connection#close` should fix the flaky tests.1 parent bd0d1b2 commit 4d0ce49
1 file changed
+7
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
34 | | - | |
35 | | - | |
36 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
37 | 41 | | |
38 | | - | |
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
| |||
0 commit comments