forked from pingcap/tiflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is an automated cherry-pick of pingcap#10351
Signed-off-by: ti-chi-bot <[email protected]>
- Loading branch information
1 parent
b118c02
commit a406dbe
Showing
19 changed files
with
973 additions
and
32 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,3 +87,42 @@ func TestPreCheckSinkURI(t *testing.T) { | |
}) | ||
} | ||
} | ||
<<<<<<< HEAD:cdc/sink/validator_test.go | ||
======= | ||
|
||
func TestValidateSink(t *testing.T) { | ||
t.Parallel() | ||
ctx := context.Background() | ||
ctx, cancel := context.WithCancel(ctx) | ||
defer cancel() | ||
replicateConfig := config.GetDefaultReplicaConfig() | ||
|
||
// test sink uri error | ||
sinkURI := "mysql://root:[email protected]:3306/" | ||
err := Validate(ctx, model.DefaultChangeFeedID("test"), sinkURI, replicateConfig, nil) | ||
require.NotNil(t, err) | ||
require.Contains(t, err.Error(), "fail to open MySQL connection") | ||
|
||
// test sink uri right | ||
sinkURI = "blackhole://" | ||
err = Validate(ctx, model.DefaultChangeFeedID("test"), sinkURI, replicateConfig, nil) | ||
require.Nil(t, err) | ||
|
||
// test bdr mode error | ||
replicateConfig.BDRMode = util.AddressOf(true) | ||
sinkURI = "blackhole://" | ||
err = Validate(ctx, model.DefaultChangeFeedID("test"), sinkURI, replicateConfig, nil) | ||
require.NotNil(t, err) | ||
require.Contains(t, err.Error(), "sink uri scheme is not supported in BDR mode") | ||
|
||
// test sink-scheme/syncpoint error | ||
replicateConfig.EnableSyncPoint = util.AddressOf(true) | ||
sinkURI = "kafka://" | ||
err = Validate(ctx, model.DefaultChangeFeedID("test"), sinkURI, replicateConfig, nil) | ||
require.NotNil(t, err) | ||
require.Contains( | ||
t, err.Error(), | ||
"sink uri scheme is not supported with syncpoint enabled", | ||
) | ||
} | ||
>>>>>>> c8ea7d0a75 (sink(ticdc): use pd clock in storage sink (#10351)):cdc/sink/validator/validator_test.go |
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.