@@ -210,6 +210,42 @@ def test_baby_gloo_timeout(self) -> None:
210
210
with self .assertRaisesRegex (TimeoutError , "timed out after 0.01 seconds" ):
211
211
a .configure (store_addr , 0 , 2 )
212
212
213
+ def test_reconfigure_baby_process_group (self ) -> None :
214
+ store = TCPStore (
215
+ host_name = "localhost" , port = 0 , is_master = True , wait_for_workers = False
216
+ )
217
+ store_addr = f"localhost:{ store .port } /prefix"
218
+
219
+ a = ProcessGroupBabyGloo ()
220
+ a .configure (store_addr , 0 , 1 )
221
+ futher_thread_1 = a ._future_thread
222
+ futher_queue_1 = a ._future_queue
223
+ p_1 = a ._p
224
+
225
+ store_addr = f"localhost:{ store .port } /prefix2"
226
+ a .configure (store_addr , 0 , 1 )
227
+ futher_thread_2 = a ._future_thread
228
+ futher_queue_2 = a ._future_queue
229
+ p_2 = a ._p
230
+
231
+ self .assertNotEqual (futher_thread_1 , futher_thread_2 )
232
+ self .assertNotEqual (futher_queue_1 , futher_queue_2 )
233
+ self .assertNotEqual (p_1 , p_2 )
234
+
235
+ # pyre-ignore[16]: optional
236
+ self .assertFalse (futher_thread_1 .is_alive ())
237
+ # pyre-ignore[16]: optional
238
+ self .assertTrue (futher_queue_1 ._closed )
239
+ # pyre-ignore[16]: optional
240
+ self .assertFalse (p_1 .is_alive ())
241
+
242
+ # pyre-ignore[16]: optional
243
+ self .assertTrue (futher_thread_2 .is_alive ())
244
+ # pyre-ignore[16]: optional
245
+ self .assertFalse (futher_queue_2 ._closed )
246
+ # pyre-ignore[16]: optional
247
+ self .assertTrue (p_2 .is_alive ())
248
+
213
249
def test_dummy (self ) -> None :
214
250
pg = ProcessGroupDummy (0 , 1 )
215
251
m = nn .Linear (3 , 4 )
0 commit comments