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