agiledragon / agiledragon/gomonkey
panic: runtime error: index out of range [0] with length 0 [darwin/arm64] [M1]
- 主要言語
- Go
- スター
- 2.3k
- フォーク
- 192
- 平均マージ
- 1日 6時間
- マージ済み PR(30日)
- 1
説明
https://github.com/kilianc/base-golang/blob/da0a110c1a5afb8cfa810282485d3dc5181040ee/fetchpeople_test.go
I am getting intermittent failures in tests and panic.
```
panic: runtime error: index out of range [0] with length 0 [recovered]
panic: runtime error: index out of range [0] with length 0
```
### Repro
run `https://github.com/kilianc/base-golang/blob/da0a110c1a5afb8cfa810282485d3dc5181040ee/go-test.sh` on a M1 and it will fail about 50% of the times
run `https://github.com/kilianc/base-golang/blob/da0a110c1a5afb8cfa810282485d3dc5181040ee/docker.sh` on a M1 and it will not fail
Succeeds on `go version go1.21.5 linux/arm64` and fails `go version go1.21.5 darwin/arm64`
### Full log:
```
--- FAIL: TestFetchPeople (0.00s)
--- FAIL: TestFetchPeople/should_return_a_list_of_people (0.00s)
fetchpeople_test.go:48:
Error Trace: /Users/kciuffolo/workspace/base-go/fetchpeople_test.go:48
Error: Expected nil, but got: &errors.errorString{s:"error"}
Test: TestFetchPeople/should_return_a_list_of_people
fetchpeople_test.go:49:
Error Trace: /Users/kciuffolo/workspace/base-go/fetchpeople_test.go:49
Error: Not equal:
expected: "http://test-url/"
actual : "initial value"
Diff:
--- Expected
+++ Actual
@@ -1 +1 @@
-http://test-url/
+initial value
Test: TestFetchPeople/should_return_a_list_of_people
fetchpeople_test.go:50:
Error Trace: /Users/kciuffolo/workspace/base-go/fetchpeople_test.go:50
Error: Not equal:
expected: 1
actual : 0
Test: TestFetchPeople/should_return_a_list_of_people
panic: runtime error: index out of range [0] with length 0 [recovered]
panic: runtime error: index out of range [0] with length 0
goroutine 22 [running]:
testing.tRunner.func1.2({0x100f9be00, 0x140000bc300})
/opt/homebrew/Cellar/go/1.21.5/libexec/src/testing/testing.go:1545 +0x1c4
testing.tRunner.func1()
/opt/homebrew/Cellar/go/1.21.5/libexec/src/testing/testing.go:1548 +0x364
panic({0x100f9be00?, 0x140000bc300?})
/opt/homebrew/Cellar/go/1.21.5/libexec/src/runtime/panic.go:914 +0x200
github.com/kilianc/go.TestFetchPeople.func3(0x0?)
/Users/kciuffolo/workspace/base-go/fetchpeople_test.go:51 +0x2dc
testing.tRunner(0x14000093ba0, 0x140000ab750)
/opt/homebrew/Cellar/go/1.21.5/libexec/src/testing/testing.go:1595 +0xf8
created by testing.(*T).Run in goroutine 19
/opt/homebrew/Cellar/go/1.21.5/libexec/src/testing/testing.go:1648 +0x318
exit status 2
FAIL github.com/kilianc/go 0.164s
```
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
評価
この issue はまだ評価されていません。