From 38aaf274a92fc620119bdf257500ee3b3f677774 Mon Sep 17 00:00:00 2001 From: Alessandro Arzilli Date: Mon, 19 Jul 2021 17:09:18 +0200 Subject: [PATCH] service/dap: fix TestPreSetBreakpoint (#2600) TestPreSetBreakpoint sometimes fail because a goroutine is stopped in some runtime/internal package instead of just 'runtime'. --- service/dap/server_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/dap/server_test.go b/service/dap/server_test.go index 71ded520..28358e06 100644 --- a/service/dap/server_test.go +++ b/service/dap/server_test.go @@ -515,7 +515,7 @@ func TestPreSetBreakpoint(t *testing.T) { wantMain := dap.Thread{Id: 1, Name: "* [Go 1] main.Increment (Thread ...)"} wantRuntime := dap.Thread{Id: 2, Name: "[Go 2] runtime.gopark"} for _, got := range tResp.Body.Threads { - if got.Id != 1 && !reMain.MatchString(got.Name) && !strings.Contains(got.Name, "runtime.") { + if got.Id != 1 && !reMain.MatchString(got.Name) && !(strings.Contains(got.Name, "runtime.") || strings.Contains(got.Name, "runtime/")) { t.Errorf("\ngot %#v\nwant []dap.Thread{%#v, %#v, ...}", tResp.Body.Threads, wantMain, wantRuntime) } }