mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 18:47:20 +01:00
test: compare optional lease snapshots without dereferencing nil
This commit is contained in:
1 parent
b31577dea0
commit
61695b30ef
1 file changed
+2
-1
@@ -4,6 +4,7 @@ import (
|
||||
control "github.com/seaweedfs/seaweed-block/core/rpc/control"
|
||||
"google.golang.org/protobuf/encoding/protowire"
|
||||
"google.golang.org/protobuf/proto"
|
||||
"reflect"
|
||||
"testing"
|
||||
)
|
||||
|
||||
@@ -48,7 +49,7 @@ func TestWorkspaceLeaseRequiresHolderServerForGrantRenewAndRegrant(t *testing.T)
|
||||
t.Errorf("%s accepted lease for server %q", stage, server)
|
||||
}
|
||||
after := h.Publisher().WorkspaceState("v")
|
||||
if !proto.Equal(leaseFact("v", before.Lease), leaseFact("v", after.Lease)) {
|
||||
if !reflect.DeepEqual(before.Lease, after.Lease) {
|
||||
t.Errorf("%s refused identity changed lease", stage)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user