Skip to content

Commit

Permalink
tests(ticdc): resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Rustin170506 committed Jan 7, 2022
1 parent 3cfe460 commit e90db6c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pkg/version/creator_version_gate.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ type CreatorVersionGate struct {
// which we use the admin job type to control the state of the changefeed.
var changefeedStateFromAdminJobVersions = []semver.Version{
// Introduced in https://github.com/pingcap/ticdc/pull/3014.
*semver.New("4.0.14"),
*semver.New("4.0.16"),
// Introduced in https://github.com/pingcap/ticdc/pull/2946.
*semver.New("5.0.5"),
*semver.New("5.0.6"),
}

// NewCreatorVersionGate creates the creator version gate.
Expand All @@ -52,7 +52,7 @@ func (f *CreatorVersionGate) ChangefeedStateFromAdminJob() bool {
for _, version := range changefeedStateFromAdminJobVersions {
// NOTICE: To compare against the same major version.
if creatorVersion.Major == version.Major &&
(creatorVersion.Equal(version) || creatorVersion.LessThan(version)) {
creatorVersion.LessThan(version) {
return true
}
}
Expand Down
9 changes: 8 additions & 1 deletion pkg/version/creator_version_gate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ func TestChangefeedStateFromAdminJob(t *testing.T) {
},
{
creatorVersion: "4.0.15",
expected: false,
expected: true,
},
{
creatorVersion: "4.0.16",
},
{
creatorVersion: "5.0.0",
Expand All @@ -50,6 +53,10 @@ func TestChangefeedStateFromAdminJob(t *testing.T) {
creatorVersion: "5.0.1",
expected: true,
},
{
creatorVersion: "5.0.6",
expected: false,
},
{
creatorVersion: "5.1.0",
expected: false,
Expand Down

0 comments on commit e90db6c

Please sign in to comment.