test: clone protobuf requests without copying lock state

This commit is contained in:
pingqiu committed 2026-11-21 20:08:15 -08:00
1 parent e6fcfd38b9
commit a489f4e1f5
1 file changed
+3 -2
@@ -4,6 +4,7 @@ import (
"testing"
control "github.com/seaweedfs/seaweed-block/core/rpc/control"
"google.golang.org/protobuf/proto"
)
// INV-WS-SAME-HOST-CLEAN-MOVE-001: retirement belongs to an epoch, so the
@@ -46,9 +47,9 @@ func TestWorkspaceRPCSameHostCleanMoveKeepsRepreparedBinding(t *testing.T) {
if _, err := ws.RegisterWorkspaceBinding(ctx, b); err != nil {
t.Fatal("same-host re-prepare refused", err)
}
forced := *req
forced := proto.Clone(req).(*control.WorkspaceMove)
forced.Kind, forced.Force = "forced", true
if _, err := ws.MoveWorkspace(ctx, &forced); err == nil {
if _, err := ws.MoveWorkspace(ctx, forced); err == nil {
t.Fatal("same-host forced move accepted over RPC")
}
if _, err := ws.MoveWorkspace(ctx, req); err != nil {