prevent timeout by un-nesting tb.Runs
License: MIT
@@ -33,8 +33,7 @@ func TestDsPeerstore(t *testing.T) {
func TestDsAddrBook(t *testing.T) {
for name, dsFactory := range dstores {
- t.Run(name, func(t *testing.T) {
- t.Run("Cacheful", func(t *testing.T) {
+ t.Run(name+" Cacheful", func(t *testing.T) {
t.Parallel()
opts := DefaultOpts()
@@ -44,7 +43,7 @@ func TestDsAddrBook(t *testing.T) {
pt.TestAddrBook(t, addressBookFactory(t, dsFactory, opts))
})
- t.Run("Cacheless", func(t *testing.T) {
+ t.Run(name+" Cacheless", func(t *testing.T) {
t.Parallel()
opts := DefaultOpts()
@@ -53,7 +52,6 @@ func TestDsAddrBook(t *testing.T) {
pt.TestAddrBook(t, addressBookFactory(t, dsFactory, opts))
})
- })
}
}
@@ -75,6 +73,8 @@ func BenchmarkDsPeerstore(b *testing.B) {
for name, dsFactory := range dstores {
b.Run(name, func(b *testing.B) {
pt.BenchmarkPeerstore(b, peerstoreFactory(b, dsFactory, caching), "Caching")
+ })
+ b.Run(name, func(b *testing.B) {
pt.BenchmarkPeerstore(b, peerstoreFactory(b, dsFactory, cacheless), "Cacheless")
})
}
