Skip to content

Commit 1d7835a

Browse files
committed
Stabilize a timing-dependent test
1 parent 4c41f39 commit 1d7835a

File tree

1 file changed

+6
-4
lines changed
  • testsuite/ada_lsp/configuration_warning_null_setting

1 file changed

+6
-4
lines changed

testsuite/ada_lsp/configuration_warning_null_setting/test.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ async def main(lsp: ALSLanguageClient) -> None:
4141
}
4242
)
4343

44-
# Wait for didChangeConfig to be handled
45-
await lsp.sleep(2)
44+
# We want to wait until the configuration change was handled before asserting test
45+
# results. didChangeConfig is handled in "Fence" priority on the ALS side, so if we
46+
# send any other request, it will be processed after the configuration change.
47+
await lsp.getCurrentProject()
4648

4749
total_log_msg = len(lsp.log_messages)
4850
total_show_msg = len(lsp.messages)
@@ -52,8 +54,8 @@ async def main(lsp: ALSLanguageClient) -> None:
5254

5355
lsp.didChangeConfig({"logThreshold": None, "insertWithClauses": None})
5456

55-
# Wait for didChangeConfig to be handled
56-
await lsp.sleep(2)
57+
# Wait for didChangeConfig to be handled by sending any other request
58+
await lsp.getCurrentProject()
5759

5860
# Check that no messages were sent after using None/null as the value for
5961
# a setting

0 commit comments

Comments
 (0)