fix: use testify instead of t.Fatal or t.Error in server package

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
Matthieu MOREL
2024-11-30 15:14:45 +01:00
parent ebb2b06b1c
commit c3fb7954ee
18 changed files with 129 additions and 296 deletions

View File

@ -18,6 +18,8 @@ import (
"testing"
"time"
"github.com/stretchr/testify/require"
betesting "go.etcd.io/etcd/server/v3/storage/backend/testing"
)
@ -39,9 +41,7 @@ func TestUpgradeDowngrade(t *testing.T) {
be, _ := betesting.NewTmpBackend(t, time.Microsecond, 10)
defer be.Close()
tx := be.BatchTx()
if tx == nil {
t.Fatal("batch tx is nil")
}
require.NotNilf(t, tx, "batch tx is nil")
tx.Lock()
defer tx.Unlock()
UnsafeCreateMetaBucket(tx)