Unverified Commit f5965a16 authored by Yujie Xia's avatar Yujie Xia Committed by GitHub
Browse files

lightning: fix test lightning_error_summary (#33616)

close pingcap/tidb#33614
parent 17a9fc4a
Showing with 8 additions and 4 deletions
+8 -4
......@@ -972,7 +972,7 @@ func (rc *Controller) saveStatusCheckpoint(ctx context.Context, tableName string
switch {
case err == nil:
break
case utils.IsRetryableError(err), utils.MessageIsRetryableStorageError(err.Error()), common.IsContextCanceledError(err):
case utils.MessageIsRetryableStorageError(err.Error()), common.IsContextCanceledError(err):
// recoverable error, should not be recorded in checkpoint
// which will prevent lightning from automatically recovering
return nil
......
......@@ -18,7 +18,6 @@ import (
"context"
"encoding/json"
"fmt"
"net"
"net/http"
"net/http/httptest"
"os"
......@@ -996,9 +995,14 @@ func (s *tableRestoreSuite) TestSaveStatusCheckpoint() {
require.NoError(s.T(), err)
require.Equal(s.T(), 0, len(rc.errorSummaries.summary))
err = rc.saveStatusCheckpoint(context.Background(), common.UniqueTable("test", "tbl"), indexEngineID, &net.DNSError{IsTimeout: true}, checkpoints.CheckpointStatusImported)
err = rc.saveStatusCheckpoint(
context.Background(),
common.UniqueTable("test", "tbl"), indexEngineID,
common.ErrChecksumMismatch.GenWithStackByArgs(0, 0, 0, 0, 0, 0),
checkpoints.CheckpointStatusImported,
)
require.NoError(s.T(), err)
require.Equal(s.T(), 0, len(rc.errorSummaries.summary))
require.Equal(s.T(), 1, len(rc.errorSummaries.summary))
start := time.Now()
err = rc.saveStatusCheckpoint(context.Background(), common.UniqueTable("test", "tbl"), indexEngineID, nil, checkpoints.CheckpointStatusImported)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment