这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@Lazar955
Copy link
Member

@Lazar955 Lazar955 commented Aug 6, 2025

closes #585

Copilot AI review requested due to automatic review settings August 6, 2025 07:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the Go version from 1.23 to 1.24.3 and adopts Go 1.24's new testing pattern by replacing context.Background() with t.Context() in test files. It also switches from the deprecated tenv linter to the newer usetesting linter that enforces this pattern.

  • Updates Go version to 1.24.3 in go.mod
  • Replaces context.Background() with t.Context() throughout test files
  • Updates linter configuration to use usetesting instead of tenv
  • Changes cmd.Printf to cmd.Println in version output

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 4 comments.

File Description
go.mod Updates Go version from 1.23.8 to 1.24.3 and removes toolchain directive
.golangci.yml Replaces deprecated tenv linter with usetesting linter
version/cmd.go Changes Printf to Println for version output
Multiple test files Replace context.Background() with t.Context() in test functions
Comments suppressed due to low confidence (1)

go.mod:3

  • Go version 1.24.3 does not exist. As of my knowledge cutoff in January 2025, the latest Go version is 1.23.x. Please verify the correct Go 1.24 version number.
go 1.24.3

func TestRollupFinalityProviderLifeCycle(t *testing.T) {
t.Parallel()
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
ctx, cancel := context.WithCancel(t.Context())
Copy link

Copilot AI Aug 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes the context from WithTimeout to WithCancel, removing the 10-minute timeout that was previously set. This could cause tests to hang indefinitely if they don't complete normally.

Suggested change
ctx, cancel := context.WithCancel(t.Context())
ctx, cancel := context.WithTimeout(t.Context(), 10*time.Minute)

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

timeout of the test is handle by go test no need for timeout of 10m inside the test, antipatter. You are welcome for the lesson bot

func TestBSNSkippingDoubleSignError(t *testing.T) {
t.Parallel()
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
ctx, cancel := context.WithCancel(t.Context())
Copy link

Copilot AI Aug 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes the context from WithTimeout to WithCancel, removing the 10-minute timeout that was previously set. This could cause tests to hang indefinitely if they don't complete normally.

Suggested change
ctx, cancel := context.WithCancel(t.Context())
ctx, cancel := context.WithTimeout(t.Context(), 10*time.Minute)

Copilot uses AI. Check for mistakes.
func TestBSNDoubleSigning(t *testing.T) {
t.Parallel()
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
ctx, cancel := context.WithCancel(t.Context())
Copy link

Copilot AI Aug 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes the context from WithTimeout to WithCancel, removing the 10-minute timeout that was previously set. This could cause tests to hang indefinitely if they don't complete normally.

Suggested change
ctx, cancel := context.WithCancel(t.Context())
ctx, cancel := context.WithTimeout(t.Context(), 10*time.Minute)

Copilot uses AI. Check for mistakes.
func TestRollupBSNCatchingUp(t *testing.T) {
t.Parallel()
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
ctx, cancel := context.WithCancel(t.Context())
Copy link

Copilot AI Aug 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes the context from WithTimeout to WithCancel, removing the 10-minute timeout that was previously set. This could cause tests to hang indefinitely if they don't complete normally.

Suggested change
ctx, cancel := context.WithCancel(t.Context())
ctx, cancel := context.WithTimeout(t.Context(), 10*time.Minute)

Copilot uses AI. Check for mistakes.
@Lazar955 Lazar955 merged commit d3dd0dc into main Aug 6, 2025
31 of 32 checks passed
@Lazar955 Lazar955 deleted the lazar/bump-go124 branch August 6, 2025 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bump go 1.24

3 participants