Skip to content

Commit e99f22f

Browse files
GiedriusSjnyi
authored andcommitted
.github: run e2e tests on newer ubuntu
I cannot reproduce chromedp panics locally so trying to see if a newer Ubuntu version would help. Signed-off-by: Giedrius Statkevičius <[email protected]> Signed-off-by: Yi Jin <[email protected]>
1 parent b6e67bc commit e99f22f

File tree

2 files changed

+11
-23
lines changed

2 files changed

+11
-23
lines changed

.github/workflows/go.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ jobs:
147147
matrix:
148148
parallelism: [8]
149149
index: [0, 1, 2, 3, 4, 5, 6, 7]
150-
runs-on: ubuntu-latest
150+
runs-on: ubuntu-24.04
151151
name: Thanos end-to-end tests
152152
env:
153153
GOBIN: /tmp/.bin

test/e2e/query_test.go

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,32 +1248,20 @@ func TestSidecarQueryEvaluation(t *testing.T) {
12481248
}
12491249
}
12501250

1251-
// An emptyCtx is never canceled, has no values, and has no deadline. It is not
1252-
// struct{}, since vars of this type must have distinct addresses.
1253-
type emptyCtx int
1251+
var chromedpAllocator context.Context
12541252

1255-
func (*emptyCtx) Deadline() (deadline time.Time, ok bool) {
1256-
return
1257-
}
1258-
1259-
func (*emptyCtx) Done() <-chan struct{} {
1260-
return nil
1261-
}
1262-
1263-
func (*emptyCtx) Err() error {
1264-
return nil
1265-
}
1266-
1267-
func (*emptyCtx) Value(key any) any {
1268-
return nil
1269-
}
1270-
1271-
func (e *emptyCtx) String() string {
1272-
return "Context"
1253+
func TestMain(m *testing.M) {
1254+
execAlloc, execCancel := chromedp.NewExecAllocator(
1255+
context.Background(),
1256+
)
1257+
chromedpAllocator = execAlloc
1258+
rc := m.Run()
1259+
execCancel()
1260+
os.Exit(rc)
12731261
}
12741262

12751263
func checkNetworkRequests(t *testing.T, addr string) {
1276-
ctx, cancel := chromedp.NewContext(new(emptyCtx))
1264+
ctx, cancel := chromedp.NewContext(chromedpAllocator)
12771265
t.Cleanup(cancel)
12781266

12791267
testutil.Ok(t, runutil.Retry(1*time.Minute, ctx.Done(), func() error {

0 commit comments

Comments
 (0)