Skip to content

Commit 7984dc0

Browse files
justinhwangclaude
andcommitted
Fix and modernize CI
Bump actions/checkout (v2 -> v7) and actions/setup-go (v5 -> v7), which drops the deprecated actions/cache@v1 that was auto-failing every run. Run checkout before setup-go and set cache-dependency-path so setup-go module caching finds go.sum (this repo checks out into $GOPATH/src). Remove the dead glide actions/cache step (no glide.lock or vendor dir in the repo). Exclude the stdlib internal/synctest package from check_no_test_deps: Go 1.25+ pulls it into production deps via sync, and its name trips the test/mock grep -- the same false positive already handled for internal/testlog. Stabilize TestIdleSweepIgnoresConnectionsWithCalls: give each ping attempt a fresh context instead of reusing a single 1s context across a 10s retry loop, which expired mid-loop and failed every remaining ping on a slow host. Stabilize TestRelayRaceCompletionAndTimeout under the coverage-instrumented run: its deliberate timeout/completion race can recycle a client id that collides with a still-active exchange, so allowlist the resulting "Couldn't register exchange." and duplicate-id "Protocol error." logs, matching the race artifacts the test already tolerates. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 8f6af1a commit 7984dc0

4 files changed

Lines changed: 18 additions & 16 deletions

File tree

.github/workflows/tests.yaml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,18 @@ jobs:
2828
LINT: "yes"
2929

3030
steps:
31-
- name: Setup Go
32-
uses: actions/setup-go@v5
33-
with:
34-
go-version: ${{ matrix.go }}
35-
3631
- name: Checkout code
37-
uses: actions/checkout@v2
32+
uses: actions/checkout@v7
3833
with:
3934
path: ${{ env.GOPATH }}/src/github.com/${{ github.repository }}
4035

41-
- name: Load cache
42-
uses: actions/cache@v1
36+
- name: Setup Go
37+
uses: actions/setup-go@v7
4338
with:
44-
path: ~/.glide/cache
45-
key: ${{ runner.os }}-go-${{ hashFiles('**/glide.lock') }}
46-
restore-keys: |
47-
${{ runner.os }}-go-
39+
go-version: ${{ matrix.go }}
40+
# Code is checked out into $GOPATH/src (above), not the workspace root,
41+
# so point setup-go's module cache at the real go.sum location.
42+
cache-dependency-path: '**/go.sum'
4843

4944
- name: Install CI
5045
run: make install_ci

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ test_relay_frame_leaks:
8585
PATH=$(BIN):$$PATH go test -parallel=4 $(TEST_ARG) relay_test.go
8686

8787
check_no_test_deps:
88-
! go list -json $(PROD_PKGS) | jq -r '.Deps | select ((. | length) > 0) | .[]' | grep -e test -e mock | grep -v '^internal/testlog'
88+
! go list -json $(PROD_PKGS) | jq -r '.Deps | select ((. | length) > 0) | .[]' | grep -e test -e mock | grep -vE '^internal/(testlog|synctest)'
8989

9090
benchmark: clean setup $(BIN)/thrift
9191
echo Running benchmarks:

idle_sweep_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,6 @@ func TestIdleSweepMisconfiguration(t *testing.T) {
319319
}
320320

321321
func TestIdleSweepIgnoresConnectionsWithCalls(t *testing.T) {
322-
ctx, cancel := NewContext(time.Second)
323-
defer cancel()
324-
325322
clientTicker := testutils.NewFakeTicker()
326323
clock := testutils.NewStubClock(time.Now())
327324

@@ -351,6 +348,11 @@ func TestIdleSweepIgnoresConnectionsWithCalls(t *testing.T) {
351348
// Client 1 will just ping, so we create a connection that should be closed.
352349
c1 := ts.NewClient(clientOpts)
353350
require.True(t, testutils.WaitFor(10*time.Second, func() bool {
351+
// Use a fresh, timeout-scaled context per attempt. A single short
352+
// context shared across this retry loop would expire partway through
353+
// and fail every remaining ping on a slow (e.g. CI) host.
354+
ctx, cancel := NewContext(testutils.Timeout(time.Second))
355+
defer cancel()
354356
return c1.Ping(ctx, ts.HostPort()) == nil
355357
}), "Ping failed")
356358

relay_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,6 +1189,11 @@ func TestRelayRaceCompletionAndTimeout(t *testing.T) {
11891189
AddLogFilter("Too many tombstones, deleting relay item immediately.", numCalls).
11901190
AddLogFilter("Received a frame without a RelayItem.", numCalls).
11911191
AddLogFilter("Attempted to create new mex after mexset shutdown.", numCalls).
1192+
// A timed-out call can have its client id recycled and collide with an
1193+
// exchange the server still treats as active, surfacing as a duplicate-id
1194+
// protocol error and a failed exchange registration.
1195+
AddLogFilter("Couldn't register exchange.", numCalls).
1196+
AddLogFilter("Protocol error.", numCalls, "error", "inbound request is already active").
11921197
SetRelayOnly()
11931198
testutils.WithTestServer(t, opts, func(t testing.TB, ts *testutils.TestServer) {
11941199
testutils.RegisterEcho(ts.Server(), nil)

0 commit comments

Comments
 (0)