code: def test_progressbar_done(client):
      L = [client.submit(inc, i) for i in range(5)]
      wait(L)
      p = ProgressWidget(L)
      client.sync(p.listen)
      assert p.status == "finished"
      assert p.bar.value == 1.0
      assert p.bar.bar_style == "success"
      assert "Finished" in p.elapsed_time.value
  
      f = client.submit(throws, L)
      wait([f])
  
      p = ProgressWidget([f])
      client.sync(p.listen)
      assert p.status == "error"
      assert p.bar.value == 0.0
      assert p.bar.bar_style == "danger"
      assert "Exception" in p.elapsed_time.value
  
      try:
          throws(1)
      except Exception as e:
          assert repr(e) in p.elapsed_time.value
  
file_path: distributed/distributed/diagnostics/tests/test_progress_widgets.py
imports: from __future__ import annotations
  import re
  from operator import add
  import pytest
  from dask.utils import key_split
  from distributed.client import wait
  from distributed.spans import span
  from distributed.utils_test import dec, gen_cluster, gen_tls_cluster, inc, throws
  from distributed.diagnostics.progressbar import MultiProgressWidget, ProgressWidget, progress
label_desc: Use image node_id 2 for calling a global function with example usage: test_progressbar_done(client) without return types