diff --git a/dtmcli/tcc.go b/dtmcli/tcc.go index c8618a2..889055a 100644 --- a/dtmcli/tcc.go +++ b/dtmcli/tcc.go @@ -58,7 +58,6 @@ func (t *Tcc) CallBranch(body interface{}, tryURL string, confirmURL string, can err := dtmimp.TransRegisterBranch(&t.TransBase, map[string]string{ "data": dtmimp.MustMarshalString(body), "branch_id": branchID, - BranchTry: tryURL, BranchConfirm: confirmURL, BranchCancel: cancelURL, }, "registerTccBranch") diff --git a/dtmgrpc/dtmgimp/dtmgimp.pb.go b/dtmgrpc/dtmgimp/dtmgimp.pb.go index 9ef264c..e73bc09 100644 --- a/dtmgrpc/dtmgimp/dtmgimp.pb.go +++ b/dtmgrpc/dtmgimp/dtmgimp.pb.go @@ -305,9 +305,8 @@ type DtmTccBranchRequest struct { Info *DtmBranchInfo `protobuf:"bytes,1,opt,name=Info,proto3" json:"Info,omitempty"` BusiPayload []byte `protobuf:"bytes,2,opt,name=BusiPayload,proto3" json:"BusiPayload,omitempty"` - Try string `protobuf:"bytes,3,opt,name=Try,proto3" json:"Try,omitempty"` - Confirm string `protobuf:"bytes,4,opt,name=Confirm,proto3" json:"Confirm,omitempty"` - Cancel string `protobuf:"bytes,5,opt,name=Cancel,proto3" json:"Cancel,omitempty"` + Confirm string `protobuf:"bytes,3,opt,name=Confirm,proto3" json:"Confirm,omitempty"` + Cancel string `protobuf:"bytes,4,opt,name=Cancel,proto3" json:"Cancel,omitempty"` } func (x *DtmTccBranchRequest) Reset() { @@ -356,13 +355,6 @@ func (x *DtmTccBranchRequest) GetBusiPayload() []byte { return nil } -func (x *DtmTccBranchRequest) GetTry() string { - if x != nil { - return x.Try - } - return "" -} - func (x *DtmTccBranchRequest) GetConfirm() string { if x != nil { return x.Confirm @@ -481,52 +473,51 @@ var file_dtmgrpc_dtmgimp_dtmgimp_proto_rawDesc = []byte{ 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x54, 0x79, 0x70, - 0x65, 0x22, 0xa7, 0x01, 0x0a, 0x13, 0x44, 0x74, 0x6d, 0x54, 0x63, 0x63, 0x42, 0x72, 0x61, 0x6e, + 0x65, 0x22, 0x95, 0x01, 0x0a, 0x13, 0x44, 0x74, 0x6d, 0x54, 0x63, 0x63, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x64, 0x74, 0x6d, 0x67, 0x69, 0x6d, 0x70, 0x2e, 0x44, 0x74, 0x6d, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x0a, 0x0b, 0x42, 0x75, 0x73, 0x69, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x42, 0x75, 0x73, 0x69, - 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x54, 0x72, 0x79, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x54, 0x72, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x72, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x72, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x22, 0x7a, 0x0a, 0x12, 0x44, - 0x74, 0x6d, 0x58, 0x61, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x2a, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x16, 0x2e, 0x64, 0x74, 0x6d, 0x67, 0x69, 0x6d, 0x70, 0x2e, 0x44, 0x74, 0x6d, 0x42, 0x72, 0x61, - 0x6e, 0x63, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x0a, - 0x0b, 0x42, 0x75, 0x73, 0x69, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x0b, 0x42, 0x75, 0x73, 0x69, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, - 0x16, 0x0a, 0x06, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x32, 0x82, 0x03, 0x0a, 0x03, 0x44, 0x74, 0x6d, 0x12, - 0x38, 0x0a, 0x06, 0x4e, 0x65, 0x77, 0x47, 0x69, 0x64, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, - 0x79, 0x1a, 0x14, 0x2e, 0x64, 0x74, 0x6d, 0x67, 0x69, 0x6d, 0x70, 0x2e, 0x44, 0x74, 0x6d, 0x47, - 0x69, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x37, 0x0a, 0x06, 0x53, 0x75, 0x62, - 0x6d, 0x69, 0x74, 0x12, 0x13, 0x2e, 0x64, 0x74, 0x6d, 0x67, 0x69, 0x6d, 0x70, 0x2e, 0x44, 0x74, + 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x72, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, + 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x22, 0x7a, 0x0a, 0x12, 0x44, 0x74, 0x6d, + 0x58, 0x61, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x2a, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, + 0x64, 0x74, 0x6d, 0x67, 0x69, 0x6d, 0x70, 0x2e, 0x44, 0x74, 0x6d, 0x42, 0x72, 0x61, 0x6e, 0x63, + 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x0a, 0x0b, 0x42, + 0x75, 0x73, 0x69, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0b, 0x42, 0x75, 0x73, 0x69, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x16, 0x0a, + 0x06, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x4e, + 0x6f, 0x74, 0x69, 0x66, 0x79, 0x32, 0x82, 0x03, 0x0a, 0x03, 0x44, 0x74, 0x6d, 0x12, 0x38, 0x0a, + 0x06, 0x4e, 0x65, 0x77, 0x47, 0x69, 0x64, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, + 0x14, 0x2e, 0x64, 0x74, 0x6d, 0x67, 0x69, 0x6d, 0x70, 0x2e, 0x44, 0x74, 0x6d, 0x47, 0x69, 0x64, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x37, 0x0a, 0x06, 0x53, 0x75, 0x62, 0x6d, 0x69, + 0x74, 0x12, 0x13, 0x2e, 0x64, 0x74, 0x6d, 0x67, 0x69, 0x6d, 0x70, 0x2e, 0x44, 0x74, 0x6d, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, + 0x12, 0x38, 0x0a, 0x07, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x12, 0x13, 0x2e, 0x64, 0x74, + 0x6d, 0x67, 0x69, 0x6d, 0x70, 0x2e, 0x44, 0x74, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x36, 0x0a, 0x05, 0x41, 0x62, + 0x6f, 0x72, 0x74, 0x12, 0x13, 0x2e, 0x64, 0x74, 0x6d, 0x67, 0x69, 0x6d, 0x70, 0x2e, 0x44, 0x74, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x22, 0x00, 0x12, 0x38, 0x0a, 0x07, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x12, 0x13, 0x2e, - 0x64, 0x74, 0x6d, 0x67, 0x69, 0x6d, 0x70, 0x2e, 0x44, 0x74, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x36, 0x0a, 0x05, - 0x41, 0x62, 0x6f, 0x72, 0x74, 0x12, 0x13, 0x2e, 0x64, 0x74, 0x6d, 0x67, 0x69, 0x6d, 0x70, 0x2e, - 0x44, 0x74, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x11, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, - 0x54, 0x63, 0x63, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x1c, 0x2e, 0x64, 0x74, 0x6d, 0x67, - 0x69, 0x6d, 0x70, 0x2e, 0x44, 0x74, 0x6d, 0x54, 0x63, 0x63, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, - 0x00, 0x12, 0x49, 0x0a, 0x10, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x58, 0x61, 0x42, - 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x1b, 0x2e, 0x64, 0x74, 0x6d, 0x67, 0x69, 0x6d, 0x70, 0x2e, - 0x44, 0x74, 0x6d, 0x58, 0x61, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x42, 0x25, 0x5a, 0x23, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x79, 0x65, 0x64, 0x66, 0x2f, - 0x64, 0x74, 0x6d, 0x2f, 0x64, 0x74, 0x6d, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x64, 0x74, 0x6d, 0x67, - 0x69, 0x6d, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x11, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x54, 0x63, + 0x63, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x1c, 0x2e, 0x64, 0x74, 0x6d, 0x67, 0x69, 0x6d, + 0x70, 0x2e, 0x44, 0x74, 0x6d, 0x54, 0x63, 0x63, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, + 0x49, 0x0a, 0x10, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x58, 0x61, 0x42, 0x72, 0x61, + 0x6e, 0x63, 0x68, 0x12, 0x1b, 0x2e, 0x64, 0x74, 0x6d, 0x67, 0x69, 0x6d, 0x70, 0x2e, 0x44, 0x74, + 0x6d, 0x58, 0x61, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x42, 0x25, 0x5a, 0x23, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x79, 0x65, 0x64, 0x66, 0x2f, 0x64, 0x74, + 0x6d, 0x2f, 0x64, 0x74, 0x6d, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x64, 0x74, 0x6d, 0x67, 0x69, 0x6d, + 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/dtmgrpc/dtmgimp/dtmgimp.proto b/dtmgrpc/dtmgimp/dtmgimp.proto index ed32f18..c211841 100644 --- a/dtmgrpc/dtmgimp/dtmgimp.proto +++ b/dtmgrpc/dtmgimp/dtmgimp.proto @@ -46,9 +46,8 @@ message DtmBranchInfo { message DtmTccBranchRequest { DtmBranchInfo Info = 1; bytes BusiPayload = 2; - string Try = 3; - string Confirm = 4; - string Cancel = 5; + string Confirm = 3; + string Cancel = 4; } message DtmXaBranchRequest { diff --git a/dtmgrpc/tcc.go b/dtmgrpc/tcc.go index cec9338..298eafd 100644 --- a/dtmgrpc/tcc.go +++ b/dtmgrpc/tcc.go @@ -73,7 +73,6 @@ func (t *TccGrpc) CallBranch(busiMsg proto.Message, tryURL string, confirmURL st BranchID: branchID, }, BusiPayload: bd, - Try: tryURL, Confirm: confirmURL, Cancel: cancelURL, }) diff --git a/dtmsvr/api.go b/dtmsvr/api.go index 756d34a..80bb984 100644 --- a/dtmsvr/api.go +++ b/dtmsvr/api.go @@ -53,8 +53,8 @@ func svcRegisterTccBranch(branch *TransBranch, data map[string]string) (interfac return map[string]interface{}{"dtm_result": dtmcli.ResultFailure, "message": fmt.Sprintf("current status: %s cannot register branch", dbt.Status)}, nil } - branches := []TransBranch{*branch, *branch, *branch} - for i, b := range []string{dtmcli.BranchCancel, dtmcli.BranchConfirm, dtmcli.BranchTry} { + branches := []TransBranch{*branch, *branch} + for i, b := range []string{dtmcli.BranchCancel, dtmcli.BranchConfirm} { branches[i].BranchType = b branches[i].URL = data[b] } diff --git a/dtmsvr/api_grpc.go b/dtmsvr/api_grpc.go index 8429267..478bb88 100644 --- a/dtmsvr/api_grpc.go +++ b/dtmsvr/api_grpc.go @@ -42,7 +42,6 @@ func (s *dtmServer) RegisterTccBranch(ctx context.Context, in *pb.DtmTccBranchRe }, map[string]string{ dtmcli.BranchCancel: in.Cancel, dtmcli.BranchConfirm: in.Confirm, - dtmcli.BranchTry: in.Try, }) return &emptypb.Empty{}, dtmgimp.Result2Error(r, err) } diff --git a/test/tcc_barrier_test.go b/test/tcc_barrier_test.go index 4f511c0..71aff5f 100644 --- a/test/tcc_barrier_test.go +++ b/test/tcc_barrier_test.go @@ -28,7 +28,7 @@ func TestTccBarrierNormal(t *testing.T) { assert.Nil(t, err) waitTransProcessed(gid) assert.Equal(t, StatusSucceed, getTransStatus(gid)) - assert.Equal(t, []string{StatusPrepared, StatusSucceed, StatusPrepared, StatusPrepared, StatusSucceed, StatusPrepared}, getBranchesStatus(gid)) + assert.Equal(t, []string{StatusPrepared, StatusSucceed, StatusPrepared, StatusSucceed}, getBranchesStatus(gid)) } func TestTccBarrierRollback(t *testing.T) { @@ -42,7 +42,7 @@ func TestTccBarrierRollback(t *testing.T) { assert.Error(t, err) waitTransProcessed(gid) assert.Equal(t, StatusFailed, getTransStatus(gid)) - assert.Equal(t, []string{StatusSucceed, StatusPrepared, StatusPrepared, StatusSucceed, StatusPrepared, StatusPrepared}, getBranchesStatus(gid)) + assert.Equal(t, []string{StatusSucceed, StatusPrepared, StatusSucceed, StatusPrepared}, getBranchesStatus(gid)) } func TestTccBarrierDisorder(t *testing.T) { @@ -75,7 +75,6 @@ func TestTccBarrierDisorder(t *testing.T) { "trans_type": "tcc", "status": StatusPrepared, "data": string(dtmimp.MustMarshal(body)), - dtmcli.BranchTry: tryURL, dtmcli.BranchConfirm: confirmURL, dtmcli.BranchCancel: cancelURL, }).Post(fmt.Sprintf("%s/%s", tcc.Dtm, "registerTccBranch")) @@ -111,7 +110,7 @@ func TestTccBarrierDisorder(t *testing.T) { return nil, fmt.Errorf("a cancelled tcc") }) assert.Error(t, err, fmt.Errorf("a cancelled tcc")) - assert.Equal(t, []string{StatusSucceed, StatusPrepared, StatusPrepared}, getBranchesStatus(gid)) + assert.Equal(t, []string{StatusSucceed, StatusPrepared}, getBranchesStatus(gid)) assert.Equal(t, StatusFailed, getTransStatus(gid)) } diff --git a/test/tcc_grpc_test.go b/test/tcc_grpc_test.go index cf5c312..b8726aa 100644 --- a/test/tcc_grpc_test.go +++ b/test/tcc_grpc_test.go @@ -24,7 +24,7 @@ func TestTccGrpcNormal(t *testing.T) { assert.Nil(t, err) waitTransProcessed(gid) assert.Equal(t, StatusSucceed, getTransStatus(gid)) - assert.Equal(t, []string{StatusPrepared, StatusSucceed, StatusPrepared, StatusPrepared, StatusSucceed, StatusPrepared}, getBranchesStatus(gid)) + assert.Equal(t, []string{StatusPrepared, StatusSucceed, StatusPrepared, StatusSucceed}, getBranchesStatus(gid)) } @@ -43,7 +43,7 @@ func TestTccGrpcRollback(t *testing.T) { assert.Equal(t, StatusAborting, getTransStatus(gid)) cronTransOnce() assert.Equal(t, StatusFailed, getTransStatus(gid)) - assert.Equal(t, []string{StatusSucceed, StatusPrepared, StatusPrepared, StatusSucceed, StatusPrepared, StatusPrepared}, getBranchesStatus(gid)) + assert.Equal(t, []string{StatusSucceed, StatusPrepared, StatusSucceed, StatusPrepared}, getBranchesStatus(gid)) } func TestTccGrpcNested(t *testing.T) { @@ -58,7 +58,7 @@ func TestTccGrpcNested(t *testing.T) { assert.Nil(t, err) waitTransProcessed(gid) assert.Equal(t, StatusSucceed, getTransStatus(gid)) - assert.Equal(t, []string{StatusPrepared, StatusSucceed, StatusPrepared, StatusPrepared, StatusSucceed, StatusPrepared, StatusPrepared, StatusSucceed, StatusPrepared}, getBranchesStatus(gid)) + assert.Equal(t, []string{StatusPrepared, StatusSucceed, StatusPrepared, StatusSucceed, StatusPrepared, StatusSucceed}, getBranchesStatus(gid)) } func TestTccGrpcType(t *testing.T) { diff --git a/test/tcc_test.go b/test/tcc_test.go index 2d19b07..fc40dea 100644 --- a/test/tcc_test.go +++ b/test/tcc_test.go @@ -21,7 +21,7 @@ func TestTccNormal(t *testing.T) { assert.Nil(t, err) waitTransProcessed(gid) assert.Equal(t, StatusSucceed, getTransStatus(gid)) - assert.Equal(t, []string{StatusPrepared, StatusSucceed, StatusPrepared, StatusPrepared, StatusSucceed, StatusPrepared}, getBranchesStatus(gid)) + assert.Equal(t, []string{StatusPrepared, StatusSucceed, StatusPrepared, StatusSucceed}, getBranchesStatus(gid)) } func TestTccRollback(t *testing.T) { @@ -38,5 +38,5 @@ func TestTccRollback(t *testing.T) { assert.Equal(t, StatusAborting, getTransStatus(gid)) cronTransOnce() assert.Equal(t, StatusFailed, getTransStatus(gid)) - assert.Equal(t, []string{StatusSucceed, StatusPrepared, StatusPrepared, StatusSucceed, StatusPrepared, StatusPrepared}, getBranchesStatus(gid)) + assert.Equal(t, []string{StatusSucceed, StatusPrepared, StatusSucceed, StatusPrepared}, getBranchesStatus(gid)) }