func testCommit(t *testing.T, conn tabletconn.TabletConn) { ctx := context.Background() err := conn.Commit(ctx, commitTransactionID) if err != nil { t.Fatalf("Commit failed: %v", err) } }
func testCommitPanics(t *testing.T, conn tabletconn.TabletConn) { t.Log("testCommitPanics") ctx := context.Background() if err := conn.Commit(ctx, commitTransactionID); err == nil || !strings.Contains(err.Error(), "caught test panic") { t.Fatalf("unexpected panic error: %v", err) } }
func testCommitError(t *testing.T, conn tabletconn.TabletConn, f *FakeQueryService) { t.Log("testCommitError") f.HasError = true testErrorHelper(t, f, "Commit", func(ctx context.Context) error { return conn.Commit(ctx, TestTarget, CommitTransactionID) }) f.HasError = false }
func testCommit(t *testing.T, conn tabletconn.TabletConn) { ctx := context.Background() ctx = callerid.NewContext(ctx, testCallerID, testVTGateCallerID) err := conn.Commit(ctx, commitTransactionID) if err != nil { t.Fatalf("Commit failed: %v", err) } }
func testCommit(t *testing.T, conn tabletconn.TabletConn, f *FakeQueryService) { t.Log("testCommit") ctx := context.Background() ctx = callerid.NewContext(ctx, TestCallerID, TestVTGateCallerID) err := conn.Commit(ctx, TestTarget, CommitTransactionID) if err != nil { t.Fatalf("Commit failed: %v", err) } }
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) } }
func testCommitError(t *testing.T, conn tabletconn.TabletConn) { t.Log("testCommitError") ctx := context.Background() err := conn.Commit(ctx, commitTransactionID) verifyError(t, err, "Commit") }
func testCommitError(t *testing.T, conn tabletconn.TabletConn) { ctx := context.Background() err := conn.Commit(ctx, commitTransactionID) verifyErrorExceptServerCode(t, err, "Commit") }
func testCommitPanics(t *testing.T, conn tabletconn.TabletConn, f *FakeQueryService) { t.Log("testCommitPanics") testPanicHelper(t, f, "Commit", func(ctx context.Context) error { return conn.Commit(ctx, TestTarget, CommitTransactionID) }) }