code: def worker_collectionfinish(self, node, ids):
          
          if self.shuttingdown:
              return
          self.config.hook.pytest_xdist_node_collection_finished(node=node, ids=ids)
          # tell session which items were effectively collected otherwise
          # the master node will finish the session with EXIT_NOTESTSCOLLECTED
          self._session.testscollected = len(ids)
          self.sched.add_node_collection(node, ids)
          if self.terminal:
              self.trdist.setstatus(node.gateway.spec, "[%d]" % (len(ids)))
          if self.sched.collection_is_completed:
              if self.terminal and not self.sched.has_pending:
                  self.trdist.ensure_show_status()
                  self.terminal.write_line("")
                  if self.config.option.verbose > 0:
                      self.terminal.write_line(
                          "scheduling tests via %s" % (self.sched.__class__.__name__)
                      )
              self.sched.schedule()
docs: worker has finished test collection.
  
          This adds the collection for this node to the scheduler.  If
          the scheduler indicates collection is finished (i.e. all
          initial nodes have submitted their collections), then tells the
          scheduler to schedule the collected items.  When initiating
          scheduling the first time it logs which scheduler is in use.