Description
While working on https://dart-review.googlesource.com/c/sdk/+/401865 I added a test to pkg\analysis_server\test\lsp\commands\fix_all_in_workspace_test.dart
as suggested by @DanTup at https://dart-review.googlesource.com/c/sdk/+/401840 for better debugging than the dart fix
tests since they should work the same way.
While testing I added @soloTest
to the newly added test AbstractLspAnalysisServerTest.test_partFile_issue59572
. And gave a try to add argument: ['./lib/part.dart']
to the Command
constructor on it. That can reliably reproduce the failure for the 5-second timeout on my machine. The stack trace:
TimeoutException after 0:00:05.000000: Future not completed
dart:async/future_impl.dart 1025:22 Future.timeout.<fn>
future_impl.dart:1025
===== asynchronous gap ===========================
test\lsp\server_abstract.dart 1139:29 LspAnalysisServerTestMixin.expectRequest
server_abstract.dart:1139
===== asynchronous gap ===========================
test\lsp\server_abstract.dart 1181:27 LspAnalysisServerTestMixin.handleExpectedRequest
server_abstract.dart:1181
===== asynchronous gap ===========================
test\lsp\server_abstract.dart 155:27 AbstractLspAnalysisServerTest.executeForEdits
server_abstract.dart:155
===== asynchronous gap ===========================
test\lsp\server_abstract.dart 369:20 AbstractLspAnalysisServerTest.verifyCommandEdits
server_abstract.dart:369
===== asynchronous gap ===========================
test\lsp\commands\fix_all_in_workspace_test.dart 169:5 AbstractFixAllInWorkspaceTest.test_partFile_issue59572
fix_all_in_workspace_test.dart:169
===== asynchronous gap ===========================
package:test_reflective_loader/test_reflective_loader.dart 261:5 _runTest
test_reflective_loader.dart:261
===== asynchronous gap ===========================
package:test_api/src/backend/declarer.dart 229:9 Declarer.test.<fn>.<fn>
declarer.dart:229
===== asynchronous gap ===========================
package:test_api/src/backend/declarer.dart 227:7 Declarer.test.<fn>
declarer.dart:227
===== asynchronous gap ===========================
package:test_api/src/backend/invoker.dart 258:9 Invoker._waitForOutstandingCallbacks.<fn>
invoker.dart:258
The place where it is failing pkg\analysis_server\test\lsp\server_abstract.dart
, line 1139, inside LspAnalysisServerTestMixin.expectRequest
. The expectRequest
contains a timeout
that defaults to that value but the method that calls it (LspAnalysisServerTestMixin.handleExpectedRequest
) also has a timeout
parameter that is not passing through (in this case not even in use).
After a talk with @DanTup on Discord about this, we think it may be safe to increase that value. We'll also take a look at the timings here and why adding these (@soloTest
and parameters
) slows down the execution. Creating this issue to track this work.
As a note, if we increase it a lot (tested with 5 min) the tests themselves fail at 30 seconds. The take from @DanTup was that this was intended to give some indication as to where would it be taking a long time to answer.