From: Roland Shoemaker Date: Thu, 12 May 2022 17:03:25 +0000 (-0700) Subject: cmd/go: don't assume decimal in test_fuzz_mutate_crash X-Git-Tag: go1.19beta1~266 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=7e33e9e7a39de0dc384f65ddc17c00bdedf85b81;p=gostls13.git cmd/go: don't assume decimal in test_fuzz_mutate_crash In the float test in test_fuzz_mutate_crash, don't assume the mutator will generate a decimal during mutation. The probability it will is quite high, but it is not guaranteed, which can cause a flake. Since we are not really testing that the mutator will do this kind of mutation, just that a mutation happens, just check that the input is not the zero value like the rest of the targets. Fixes #52852 Change-Id: I4640be640204ced01b4dc749c74b46da968ea7df Reviewed-on: https://go-review.googlesource.com/c/go/+/405855 Run-TryBot: Bryan Mills Reviewed-by: Bryan Mills Auto-Submit: Roland Shoemaker TryBot-Result: Gopher Robot --- diff --git a/src/cmd/go/testdata/script/test_fuzz_mutate_crash.txt b/src/cmd/go/testdata/script/test_fuzz_mutate_crash.txt index 99bae1daf0..d2ded27f85 100644 --- a/src/cmd/go/testdata/script/test_fuzz_mutate_crash.txt +++ b/src/cmd/go/testdata/script/test_fuzz_mutate_crash.txt @@ -241,8 +241,7 @@ func FuzzBool(f *testing.F) { func FuzzFloat(f *testing.F) { f.Fuzz(func(t *testing.T, a float64) { - if a != float64(int64(a)) { - // It has a decimal, so it was mutated by division + if a != 0 { panic("this input caused a crash!") } })