File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -128,22 +128,35 @@ def test_connection_pool_starts_reaper_in_fork
128
128
pool = ConnectionPool . new ( pool_config )
129
129
pool . checkout
130
130
131
+ # We currently have a bug somewhere which leads for this test case to be deadlocked
132
+ # and timeout after 30 minutes on the CI. Until that bug is fixed, this test is made
133
+ # to timeout after a short period of time to reduce the damage.
134
+ reader , writer = IO . pipe
135
+
131
136
pid = fork do
137
+ reader . close
132
138
pool = ConnectionPool . new ( pool_config )
133
139
134
140
conn , child = new_conn_in_thread ( pool )
135
141
child . terminate
136
142
137
143
wait_for_conn_idle ( conn )
144
+ writer . close
138
145
if conn . in_use?
139
146
exit! ( 1 )
140
147
else
141
148
exit! ( 0 )
142
149
end
143
150
end
144
151
145
- Process . waitpid ( pid )
146
- assert_predicate $?, :success?
152
+ writer . close
153
+ completed = reader . wait_readable ( 20 )
154
+ reader . close
155
+ unless completed
156
+ Process . kill ( "ABRT" , pid )
157
+ end
158
+ _ , status = Process . wait2 ( pid )
159
+ assert_predicate status , :success?
147
160
ensure
148
161
pool . discard!
149
162
end
You can’t perform that action at this time.
0 commit comments