code: def test_compute_sync(client):
      @dask.delayed
      def f(n, counter):
          assert isinstance(counter, Actor), type(counter)
          for _ in range(n):
              counter.increment().result()
  
      @dask.delayed
      def check(counter, blanks):
          return counter.n
  
      counter = dask.delayed(Counter)()
      values = [f(i, counter) for i in range(5)]
      final = check(counter, values)
  
      result = final.compute(actors=counter)
      assert result == 0 + 1 + 2 + 3 + 4
  
      def check(dask_worker):
          return len(dask_worker.data) + len(dask_worker.actors)
  
      start = time()
      while any(client.run(check).values()):
          sleep(0.01)
          assert time() < start + 30
  
imports: from __future__ import annotations
  import asyncio
  import operator
  from time import sleep
  import pytest
  import dask
  from distributed import Actor, BaseActorFuture, Client, Future, Nanny, as_completed, get_client, wait, worker_client
  from distributed.metrics import time
  from distributed.utils import LateLoopEvent
  from distributed.utils_test import cluster, double, gen_cluster, inc
  from distributed.worker import get_worker
label_desc: Use image node_id 3 for calling a global function with example usage: test_compute_sync(client) and returns: counter, unknown