@@ -258,15 +258,8 @@ def test_pubsub_subscriptions_bounded_for_regular_cluster(ray_start_cluster):
258258 cluster = ray_start_cluster
259259 cluster .wait_for_nodes ()
260260
261- # Spin up several workers. Each task blocks until all of them are running,
262- # so Ray is forced to start a distinct worker process per task instead of
263- # reusing a couple of them. This is what makes the assertions below
264- # meaningful: they must hold with many workers alive, not just a few.
265- #
266- # The barrier is deliberately a shared directory rather than a SignalActor:
267- # a worker holding an actor handle subscribes to that actor's key on
268- # GCS_ACTOR_CHANNEL, which would make the actor channel counts asserted
269- # below scale with num_workers and mask exactly what this test guards.
261+ # Spin up several workers. and block them so that ray is forced to create new workers for each task
262+ # we avoid using a signal actor for this because it would create a subscription for each worker.
270263 barrier_dir = tempfile .mkdtemp ()
271264
272265 @ray .remote (num_cpus = 0.5 )
@@ -300,12 +293,13 @@ def f(self):
300293 session_dir = ray ._private .worker .global_worker .node .address_info ["session_dir" ]
301294 gcs_log_path = os .path .join (session_dir , "logs" , "gcs_server.out" )
302295
303- # Total long-polling connections into the GCS publisher. Measured with
304- # num_nodes=3: the 3 raylets, the driver, the generator actor's worker, and
305- # 2 dashboard/agent subscribers. The exact value matters less than the
296+ # 3 raylets (num_nodes=3) + 1 driver + 1 generator actor's worker + 2 from the
297+ # dashboard head(its node-info and actor subscribers each mint their own
298+ # subscriber id (gcs_pubsub.py _SubscriberBase.__init__), so one process
299+ # holds two long-poll connections). The exact value matters less than the
306300 # invariant it pins: it must not grow with num_workers (verified unchanged
307301 # at num_workers=6 and num_workers=12).
308- expected_long_polling_subscribers = 7
302+ expected_long_polling_subscribers = num_nodes + 4
309303
310304 def check ():
311305 stats = _gcs_publisher_stats (gcs_log_path )
0 commit comments