)]}'
{
  "commit": "1b04589b5d2458bc4bb0dd68e3bf87c4c3759a02",
  "tree": "952f5fd673bf456c1bee096bf78cf432deaa9f61",
  "parents": [
    "d80fab4a8a6d630a6c4e55eac7032126b7035091"
  ],
  "author": {
    "name": "Danny Tuppeny",
    "email": "danny@tuppeny.com",
    "time": "Tue Jan 07 13:14:11 2025 -0800"
  },
  "committer": {
    "name": "Commit Queue",
    "email": "dart-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "time": "Tue Jan 07 13:14:11 2025 -0800"
  },
  "message": "[analysis_server] Improve error reported by handleExpectedRequest when the expected request never arrives\n\nThe `handleExpectedRequest` test method sends a request to the server and expects a request back (for example executing a command that will trigger server-to-client applyEdit). There is a timeout (since this request may never come), but in the case where the timeout is caused by the outbound request failing, we should report that failure instead (since it is certainly the cause of the timeout).\n\nThis changes the code to capture the error from the outbound request, and _if_ the expected request never comes, throws that in preference to the timeout.\n\nBefore:\n\n```\n00:05 +0 -1: ApplyAllFixesInWorkspace | test_partFile_issue59572 [E]\n\n  TimeoutException after 0:00:05.000000: Future not completed\n\n  test\\lsp\\server_abstract.dart 1143:15                             LspAnalysisServerTestMixin.expectRequest.\u003cfn\u003e\n  dart:async/zone.dart 1517:47                                      _rootRun\n  dart:async/zone.dart 1422:19                                      _CustomZone.run\n  dart:async/future_impl.dart 1036:34                               Future.timeout.\u003cfn\u003e\n  \u003d\u003d\u003d\u003d\u003d asynchronous gap \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n  test\\lsp\\server_abstract.dart 1139:29                             LspAnalysisServerTestMixin.expectRequest\n  \u003d\u003d\u003d\u003d\u003d asynchronous gap \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n  test\\lsp\\server_abstract.dart 1190:27                             LspAnalysisServerTestMixin.handleExpectedRequest\n  \u003d\u003d\u003d\u003d\u003d asynchronous gap \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n  test\\lsp\\server_abstract.dart 155:27                              AbstractLspAnalysisServerTest.executeForEdits\n```\n\nAfter:\n\n```\n00:05 +0 -1: ApplyAllFixesInWorkspace | test_partFile_issue59572 [E]\n\n  {\n      \"code\": -32006,\n      \"message\": \"dart.edit.fixAllInWorkspace requires a single Map argument\"\n  }\n\n  test\\lsp\\server_abstract.dart 1211:7  LspAnalysisServerTestMixin.handleExpectedRequest.\u003cfn\u003e\n  dart:async/zone.dart 1538:47          _rootRunUnary\n  dart:async/zone.dart 1429:19          _CustomZone.runUnary\n  dart:async/future_impl.dart 229:22    _FutureListener.handleError\n  dart:async/future_impl.dart 944:47    Future._propagateToListeners.handleError\n  dart:async/future_impl.dart 965:13    Future._propagateToListeners\n  dart:async/future_impl.dart 730:5     Future._completeError\n```\n\nAdditionally, if the timeout is not because of a failed outbound request, the error message is now like \"Did not receive the expected workspace/applyEdit request from the server in the timeout period\" instead of \"Future not completed\".\n\nFixes https://github.com/dart-lang/sdk/issues/59780\n\nChange-Id: I8b8cc25194390ffffbe034eae313504792a42211\nReviewed-on: https://dart-review.googlesource.com/c/sdk/+/403460\nReviewed-by: Samuel Rawlins \u003csrawlins@google.com\u003e\nReviewed-by: Brian Wilkerson \u003cbrianwilkerson@google.com\u003e\nCommit-Queue: Brian Wilkerson \u003cbrianwilkerson@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "fd8512aab7729a8ea602f78f385484554295f9e3",
      "old_mode": 33188,
      "old_path": "pkg/analysis_server/test/lsp/server_abstract.dart",
      "new_id": "ca6b503458a46cf2721dc47b8a019dafe64a3d4f",
      "new_mode": 33188,
      "new_path": "pkg/analysis_server/test/lsp/server_abstract.dart"
    }
  ]
}
