use t.TempDir instead of ioutil.TempDir in unit tests#10321
use t.TempDir instead of ioutil.TempDir in unit tests#10321ianwoolf wants to merge 2 commits intoprometheus:mainfrom
Conversation
bd8fec1 to
438747e
Compare
LeviHarrison
left a comment
There was a problem hiding this comment.
Thanks! And welcome to the project!
promql/engine_test.go
Outdated
| dir, err := ioutil.TempDir("", "test_concurrency") | ||
| require.NoError(t, err) | ||
| dir := t.TempDir() | ||
| defer os.RemoveAll(dir) |
There was a problem hiding this comment.
Apologies, I thought the test_windows failure was a flake (as it usually is), but there is actually a problem. defer os.RemoveAll(dir) should be removed as well, as t.TempDir() takes care of deleting the files.
There was a problem hiding this comment.
emm... I didn't notice the the tmp dir was automatically removed.
438747e to
39afd26
Compare
|
I think there's just one last thing: the |
39afd26 to
4ae36a0
Compare
fix |
|
OK, so I think I've figured out why In order to fix this, these two https://github.com/ianwoolf/prometheus/blob/4ae36a0575b4a4bc243862231a0cf4e613d7970c/promql/engine_test.go#L58 That should fix it. |
4ae36a0 to
7a7d891
Compare
only registering the I add and i pass the test on mac and linux, it still fails on windows. The error log is not |
0f862c6 to
e9f136a
Compare
d4d4213 to
d77232a
Compare
|
cc @ianwoolf can you please rebase this pull request? Thanks! |
Signed-off-by: ianwoolf <[email protected]>
d77232a to
4cb3a13
Compare
done :) |
|
Discussed in the bug scrub; apologies we dropped the ball in July. This still looks worthwhile, however at the last CI run Windows tests failed and something needs a DCO signed-off line. @ianwoolf could you add the signed-off, rebase again and we can try to figure out the Windows test? |
|
I think this PR can now be safely closed, since after rebasing on main and fixing conflicts, there are no changes left. |
|
Thanks! |
Signed-off-by: ianwoolf [email protected]
Updates #9594