ipni / index-provider

📢 Index Provider

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Intermittent `index out of range [0] with length 0` error in mirror test

gammazero opened this issue · comments

Occasionally seeing:

=== RUN   TestMirror_PreviousIDIsPreservedOnStartFromPartialAdChain
panic: runtime error: index out of range [0] with length 0

goroutine 19243 [running]:
github.com/filecoin-project/index-provider/mirror.(*Mirror).syncAds(0xc005390780, {0x17dbe30, 0xc006f64e80}, {0x17eba38, 0xc00771a260})
	/home/runner/work/index-provider/index-provider/mirror/mirror.go:393 +0x3af
github.com/filecoin-project/index-provider/mirror.(*Mirror).Start.func1()
	/home/runner/work/index-provider/index-provider/mirror/mirror.go:146 +0x457
created by github.com/filecoin-project/index-provider/mirror.(*Mirror).Start
	/home/runner/work/index-provider/index-provider/mirror/mirror.go:121 +0xd5
FAIL	github.com/filecoin-project/index-provider/mirror	18.332s
?   	github.com/filecoin-project/index-provider/mock	[no test files]
-test.shuffle 1668048075357142525

Fixed in #290

  • Panic avoided by checking for addresses
  • Test failure avoided by waiting for peerstore to populate.