Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Close FDs on TestFileConsole to avoid issues on Win #4607

Merged
merged 1 commit into from
Mar 6, 2025

Conversation

joanlopez
Copy link
Contributor

@joanlopez joanlopez commented Mar 6, 2025

What?

It closes the open file descriptors on the logger's output file on TestFileConsole.

Why?

Because, as discussed here, that's what's causing that test to fail on Windows.

@joanlopez joanlopez changed the base branch from master to bumpGolangci March 6, 2025 15:51
@joanlopez joanlopez changed the title Bump golangci 2 Chore: Close FDs on TestFileConsole to avoid issues on Win Mar 6, 2025
@@ -378,7 +378,6 @@ func TestFileConsole(t *testing.T) {
f, err := os.CreateTemp(t.TempDir(), "") //nolint:forbidigo // fix with https://github.com/grafana/k6/issues/2565
require.NoError(t, err)
logFilename := f.Name()
defer os.Remove(logFilename) //nolint:errcheck,forbidigo // fix with https://github.com/grafana/k6/issues/2565
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this line is no longer required, as t.TempDir() is responsible, thanks to t.Cleanup() behavior, to completely remove the temporary directory created for this test, once it finishes. Right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems reasonable - I did remove some lines like this from some places, but likely missed some as well

@joanlopez joanlopez marked this pull request as ready for review March 6, 2025 16:04
@joanlopez joanlopez requested a review from a team as a code owner March 6, 2025 16:04
@joanlopez joanlopez requested review from mstoykov and inancgumus and removed request for a team March 6, 2025 16:04
@mstoykov mstoykov merged commit 3f6773b into bumpGolangci Mar 6, 2025
28 checks passed
@mstoykov mstoykov deleted the bumpGolangci-2 branch March 6, 2025 16:31
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.

2 participants