diff --git a/internal/langserver/handlers/code_lens_test.go b/internal/langserver/handlers/code_lens_test.go index b1d2a7130..1c252c431 100644 --- a/internal/langserver/handlers/code_lens_test.go +++ b/internal/langserver/handlers/code_lens_test.go @@ -262,6 +262,9 @@ variable "instances" { type = number } `, submodUri.URI())}) + // TODO remove once we support synchronous dependent tasks + // See https://github.com/hashicorp/terraform-ls/issues/719 + time.Sleep(2 * time.Second) ls.CallAndExpectResponse(t, &langserver.CallRequest{ Method: "textDocument/codeLens", ReqParams: fmt.Sprintf(`{ diff --git a/internal/langserver/handlers/complete_test.go b/internal/langserver/handlers/complete_test.go index 142e7f455..62cc0179c 100644 --- a/internal/langserver/handlers/complete_test.go +++ b/internal/langserver/handlers/complete_test.go @@ -717,11 +717,9 @@ output "test" { } }`, mainCfg, tmpDir.URI())}) - // module manifest-dependent tasks are scheduled & executed - // asynchronously and we currently have no way of waiting - // for them to complete. // TODO remove once we support synchronous dependent tasks - time.Sleep(1500 * time.Millisecond) + // See https://github.com/hashicorp/terraform-ls/issues/719 + time.Sleep(2 * time.Second) ls.CallAndExpectResponse(t, &langserver.CallRequest{ Method: "textDocument/completion", diff --git a/internal/langserver/handlers/go_to_ref_target_test.go b/internal/langserver/handlers/go_to_ref_target_test.go index ef14ed9bc..64c137600 100644 --- a/internal/langserver/handlers/go_to_ref_target_test.go +++ b/internal/langserver/handlers/go_to_ref_target_test.go @@ -4,6 +4,7 @@ import ( "fmt" "path/filepath" "testing" + "time" "github.com/hashicorp/go-version" "github.com/hashicorp/terraform-ls/internal/langserver" @@ -154,6 +155,9 @@ func TestDefinition_moduleInputToVariable(t *testing.T) { "uri": "%s/main.tf" } }`, modUri.URI())}) + // TODO remove once we support synchronous dependent tasks + // See https://github.com/hashicorp/terraform-ls/issues/719 + time.Sleep(2 * time.Second) ls.CallAndExpectResponse(t, &langserver.CallRequest{ Method: "textDocument/definition", ReqParams: fmt.Sprintf(`{ diff --git a/internal/langserver/handlers/references_test.go b/internal/langserver/handlers/references_test.go index 8dc187fff..051499f47 100644 --- a/internal/langserver/handlers/references_test.go +++ b/internal/langserver/handlers/references_test.go @@ -4,6 +4,7 @@ import ( "fmt" "path/filepath" "testing" + "time" "github.com/hashicorp/go-version" "github.com/hashicorp/terraform-ls/internal/langserver" @@ -178,6 +179,9 @@ variable "instances" { "uri": "%s/main.tf" } }`, submodUri.URI())}) + // TODO remove once we support synchronous dependent tasks + // See https://github.com/hashicorp/terraform-ls/issues/719 + time.Sleep(2 * time.Second) ls.CallAndExpectResponse(t, &langserver.CallRequest{ Method: "textDocument/references", ReqParams: fmt.Sprintf(`{