Exemplo n.º 1
0
func testRollback2Panics(t *testing.T, conn tabletconn.TabletConn) {
	t.Log("testRollback2Panics")
	ctx := context.Background()
	if err := conn.Rollback2(ctx, rollbackTransactionID); err == nil || !strings.Contains(err.Error(), "caught test panic") {
		t.Fatalf("unexpected panic error: %v", err)
	}
}
Exemplo n.º 2
0
func testRollback2(t *testing.T, conn tabletconn.TabletConn) {
	ctx := context.Background()
	ctx = callerid.NewContext(ctx, testCallerID, testVTGateCallerID)
	err := conn.Rollback2(ctx, rollbackTransactionID)
	if err != nil {
		t.Fatalf("Rollback2 failed: %v", err)
	}
}
Exemplo n.º 3
0
func testRollback2(t *testing.T, conn tabletconn.TabletConn) {
	t.Log("testRollback2")
	ctx := context.Background()
	err := conn.Rollback2(ctx, rollbackTransactionID)
	if err != nil {
		t.Fatalf("Rollback2 failed: %v", err)
	}
}
Exemplo n.º 4
0
func testRollbackError(t *testing.T, conn tabletconn.TabletConn) {
	t.Log("testCommitError")
	ctx := context.Background()
	var err error
	if *tabletserver.RPCErrorOnlyInReply {
		err = conn.Rollback2(ctx, commitTransactionID)
	} else {
		err = conn.Rollback(ctx, commitTransactionID)
	}
	if err == nil {
		t.Fatalf("Rollback was expecting an error, didn't get one")
	}
	if !strings.Contains(err.Error(), expectedErrMatch) {
		t.Errorf("Unexpected error from Rollback: got %v, wanted err containing %v", err, expectedErrMatch)
	}
}
Exemplo n.º 5
0
func testRollback2Error(t *testing.T, conn tabletconn.TabletConn) {
	t.Log("testRollback2Error")
	ctx := context.Background()
	err := conn.Rollback2(ctx, commitTransactionID)
	verifyError(t, err, "Rollback2")
}