Skip to content

Commit

Permalink
patches: update for go 1.22
Browse files Browse the repository at this point in the history
  • Loading branch information
eandre committed Feb 26, 2024
1 parent c2c4e03 commit a3f57e0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
8 changes: 4 additions & 4 deletions patches/runtime_patch.diff
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ index aba2e2b27b..588a98ff74 100644
sched.ngsys.Add(1)

diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go
index f4c76abd1c..190381b454 100644
index 63320d4a8a..f3be797f7d 100644
--- a/src/runtime/runtime2.go
+++ b/src/runtime/runtime2.go
@@ -493,6 +493,8 @@ type g struct {
timer *timer // cached timer for time.Sleep
selectDone atomic.Uint32 // are we participating in a select and did someone win the race?
@@ -510,6 +510,8 @@ type g struct {

coroarg *coro // argument during coroutine transfers

+ encore unsafe.Pointer // encore-specific goroutine data
+
Expand Down
15 changes: 8 additions & 7 deletions patches/testing_patch.diff
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ test runs against global state. This patch introduces a per test level callback
test and not have state between tests interfere with each other.

diff --git a/src/testing/testing.go b/src/testing/testing.go
index fcf7048f23..ec628da6ed 100644
index 5c06aea5f8..0db6bb40ab 100644
--- a/src/testing/testing.go
+++ b/src/testing/testing.go
@@ -765,6 +765,12 @@ func (c *common) frameSkip(skip int) runtime.Frame {
@@ -767,6 +767,12 @@ func (c *common) frameSkip(skip int) runtime.Frame {
// and inserts the final newline if needed and indentation spaces for formatting.
// This function must be called with c.mu held.
func (c *common) decorate(s string, skip int) string {
Expand All @@ -22,7 +22,7 @@ index fcf7048f23..ec628da6ed 100644
frame := c.frameSkip(skip)
file := frame.File
line := frame.Line
@@ -1399,10 +1405,14 @@ func (t *T) Parallel() {
@@ -1479,10 +1485,14 @@ func (t *T) Parallel() {
}
running.Delete(t.name)

Expand All @@ -37,18 +37,19 @@ index fcf7048f23..ec628da6ed 100644
if t.chatty != nil {
t.chatty.Updatef(t.name, "=== CONT %s\n", t.name)
}
@@ -1451,12 +1461,14 @@ var errNilPanicOrGoexit = errors.New("test executed panic(nil) or runtime.Goexit
@@ -1538,6 +1548,7 @@ var errNilPanicOrGoexit = errors.New("test executed panic(nil) or runtime.Goexit

func tRunner(t *T, fn func(t *T)) {
t.runner = callerName(0)
+ encoreStartTest(t, fn)

// When this goroutine is done, either because fn(t)
// returned normally or because a test failure triggered
// a call to runtime.Goexit, record the duration and send
@@ -1545,6 +1556,7 @@ func tRunner(t *T, fn func(t *T)) {
// a signal saying that the test is done.
defer func() {
t.checkRaces()
+ encoreEndTest(t)

// TODO(#61034): This is the wrong place for this check.
if t.Failed() {
numFailed.Add(1)
}

0 comments on commit a3f57e0

Please sign in to comment.