Skip to content

Commit

Permalink
Miscellaneous fixes for problems uncovered by Github Actions tests (g…
Browse files Browse the repository at this point in the history
…o-delve#2274)

Fix bug in DAP test: TestEvaluateCallRequest.
In Go 1.15 the call injection will be executed on a different goroutine
from the goroutine where it was started on to avoid confusing the
garbage collector, the test must be aware of this fact and use the
goroutine ID from the stopped response instead of assuming 1 is the
currently selected goroutine.

Disables TestAttachDetach when running in Github Actions.

Disable some coredump tests when running in Github Actions (core size
limits?).
  • Loading branch information
aarzilli committed Dec 27, 2020
1 parent e7558c5 commit 7dcd7b4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
6 changes: 6 additions & 0 deletions pkg/proc/core/core_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ func TestCore(t *testing.T) {
if runtime.GOOS != "linux" || runtime.GOARCH != "amd64" {
return
}
if runtime.GOOS == "linux" && os.Getenv("CI") == "true" && buildMode == "pie" {
t.Skip("disabled on linux, Github Actions, with PIE buildmode")
}
p := withCoreFile(t, "panic", "")

gs, _, err := proc.GoroutinesInfo(p, 0, 0)
Expand Down Expand Up @@ -349,6 +352,9 @@ func TestCoreWithEmptyString(t *testing.T) {
if runtime.GOOS != "linux" || runtime.GOARCH != "amd64" {
return
}
if runtime.GOOS == "linux" && os.Getenv("CI") == "true" && buildMode == "pie" {
t.Skip("disabled on linux, Github Actions, with PIE buildmode")
}
p := withCoreFile(t, "coreemptystring", "")

gs, _, err := proc.GoroutinesInfo(p, 0, 0)
Expand Down
3 changes: 3 additions & 0 deletions pkg/proc/proc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2816,6 +2816,9 @@ func TestAttachDetach(t *testing.T) {
if testBackend == "rr" {
return
}
if os.Getenv("CI") == "true" {
t.Skip("disabled on Github actions")
}
var buildFlags protest.BuildFlags
if buildMode == "pie" {
buildFlags |= protest.BuildModePIE
Expand Down
9 changes: 2 additions & 7 deletions service/dap/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1462,17 +1462,12 @@ func TestEvaluateCallRequest(t *testing.T) {
// and not the return to the original point of injection after it
// completed.
client.EvaluateRequest("call makeclos(nil)", 1000, "not watch")
client.ExpectStoppedEvent(t)
stopped := client.ExpectStoppedEvent(t)
erres = client.ExpectVisibleErrorResponse(t)
if erres.Body.Error.Format != "Unable to evaluate expression: call stopped" {
t.Errorf("\ngot %#v\nwant Format=\"Unable to evaluate expression: call stopped\"", erres)
}
if (goversion.VersionAfterOrEqual(runtime.Version(), 1, 15) && (runtime.GOOS == "linux" || runtime.GOOS == "windows")) ||
runtime.GOOS == "freebsd" {
handleStop(t, client, 1, "runtime.debugCallWrap", -1)
} else {
handleStop(t, client, 1, "main.makeclos", 88)
}
handleStop(t, client, stopped.Body.ThreadId, "main.makeclos", 88)

// Complete the call and get back to original breakpoint in makeclos()
client.ContinueRequest(1)
Expand Down

0 comments on commit 7dcd7b4

Please sign in to comment.