Update to Go 1.25#692
Conversation
bf3cf05 to
b31821c
Compare
Luap99
left a comment
There was a problem hiding this comment.
you have two "Use slices.SortFunc instead of sort.Sort" commits which looks a bit odd, should they be squashed or if we like to have parts for easier bisect then part 1/2 names?
| Expect(res[defNet].DNSServerIPs).To(BeEmpty()) | ||
| Expect(res[defNet].DNSSearchDomains).To(BeEmpty()) | ||
| var wg sync.WaitGroup | ||
| wg.Add(1) |
There was a problem hiding this comment.
there are WIP PRs to remove all cni so in the interest of avoiding merge conflicts it may be best to not touch cni files, though I guess that conflict would be easy to resolve so it should not matter to much
cc @lsm5
Ah nvm me, sort.Sort vs sort.Slice so all good |
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
It does nothing. We might want to use "omitzero" in various cases, but if no-one has noticed so far, it's probably not urgent. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
... at least where we don't care about the values, I rather dislike using this when we need to do range over exactly [0, N). Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
It's shorter code, and less chance of typos. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
It is typically safer and expected to be faster. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
... and then preallocate an array to avoid a now-visible warning. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
|
@mtrmac Not sure if the test failures are real here? Maybe rebase and I then I am good to merge if it passes. |
We updated most repos to 1.25, only container-libs is not yet merged containers/container-libs#692 I am not sure this change is needed, it seems renovate PRs are correctly created with go 1.25 despite this still being set to 1.24. Regardless lets be safe and bump this for now. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
|
Almost certainly flakes, anyway rebased. |
| names = append(names, name) | ||
| go func(name string) { | ||
| defer wg.Done() | ||
| wg.Go(func() { |
There was a problem hiding this comment.
wg.Go requires that the func f does not panic. Is require.NoError going to panic in case of failures?
There was a problem hiding this comment.
Well the rules in testing say that FailNow (and therefore require) can only be used on the original goroutine of the test, so this test is already buggy in that sense. I think we are violating that rule all over the place…
Ultimately, maybe It doesn’t really matter whether we fail via an assertion error in the testing framework, via an uncaught panic, or via (as I think will happen) this goroutine exiting, marking the test as failed, but not truly aborting the rest of the test:
func TestGroup(t *testing.T) {
wg := sync.WaitGroup{}
wg.Go(func() {
t.Log("sub 1")
require.False(t, true, "test failed")
t.Log("sub after fail")
})
t.Log("main waiting")
wg.Wait()
t.Log("main after wait")
}produces
=== RUN TestGroup
…: main waiting
…: sub 1
…:
Error Trace: …
Error: Should be false
Test: TestGroup
Messages: test failed
…: main after wait
--- FAIL: TestGroup (0.00s)
where the parent goroutine does continue, but otherwise it works out… fine enough.
(A clean fix could be to use x/sync/errgroup to collect the errors.)
There was a problem hiding this comment.
Got it, so it LGTM. Thanks!
| names = append(names, name) | ||
| go func(name string) { | ||
| defer wg.Done() | ||
| wg.Go(func() { |
Use new features, clean up what
go fixfound, and avoid the old-stylesort.See individual commit messages for details.