Repository: cylc/cylc-uiserver (language: python)

Issue:
Improve cat-log test failure debuggability
**Check List**

- [x] I have read `CONTRIBUTING.md` and added my name as a Code Contributor.
- [x] Contains logically grouped changes (else tidy your branch by rebase).
- [x] Does not contain off-topic changes (use other PRs for other changes).
- [x] Tests 
- [X] No changelog needed
- [x] No docs needed
- [x] If this is a bug fix, PR should be raised against the relevant `?.?.x` branch.



Discussion / hints:

Fix patch:
diff --git a/setup.cfg b/setup.cfg
index 60f300d3..aded9d17 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -56,6 +56,7 @@ install_requires =
     graphql-ws==0.4.4
     jupyter_server>=2.7
     requests
+    psutil
     tornado>=6.1.0  # matches jupyter_server value
     traitlets>=5.2.1  # required for logging_config (5.2.0 had bugs)
 


Test patch:
diff --git a/cylc/uiserver/tests/test_resolvers.py b/cylc/uiserver/tests/test_resolvers.py
index 7ebd0993..ad8d58aa 100644
--- a/cylc/uiserver/tests/test_resolvers.py
+++ b/cylc/uiserver/tests/test_resolvers.py
@@ -89,11 +89,14 @@ async def test_cat_log(workflow_run_dir):
     # note - timeout tests that the cat-log process is being stopped correctly
 
     first_response = None
-    async with timeout(10):
+    async with timeout(20):
         ret = services.cat_log(workflow, log, info)
         actual = ''
         is_first = True
         async for response in ret:
+            if err := response.get('error'):
+                # Surface any unexpected errors for better visibility
+                log.exception(err)
             if is_first:
                 first_response = response
                 is_first = False