-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lightning: support disable scheduler by key range (#34130)
close #35148
- Loading branch information
1 parent
3f8df8c
commit 3dd54b8
Showing
17 changed files
with
416 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright 2022 PingCAP, Inc. Licensed under Apache-2.0. | ||
|
||
package errors_test | ||
|
||
import ( | ||
"context" | ||
"net/url" | ||
"testing" | ||
|
||
"github.com/pingcap/errors" | ||
berrors "github.com/pingcap/tidb/br/pkg/errors" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestIsContextCanceled(t *testing.T) { | ||
require.False(t, berrors.IsContextCanceled(nil)) | ||
require.False(t, berrors.IsContextCanceled(errors.New("connection closed"))) | ||
require.True(t, berrors.IsContextCanceled(context.Canceled)) | ||
require.True(t, berrors.IsContextCanceled(context.DeadlineExceeded)) | ||
require.True(t, berrors.IsContextCanceled(errors.Trace(context.Canceled))) | ||
require.True(t, berrors.IsContextCanceled(errors.Trace(context.DeadlineExceeded))) | ||
require.True(t, berrors.IsContextCanceled(&url.Error{Err: context.Canceled})) | ||
require.True(t, berrors.IsContextCanceled(&url.Error{Err: context.DeadlineExceeded})) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.