Skip to content

Commit

Permalink
fix TestSkipNotExistsTable
Browse files Browse the repository at this point in the history
  • Loading branch information
Slach committed Jul 25, 2023
1 parent a0c1439 commit b0df795
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1414,11 +1414,13 @@ func TestSkipNotExistsTable(t *testing.T) {
r.NoError(err)
err = ch.chbackend.Query(ifNotExistsInsertSQL)
r.NoError(err)
log.Infof("pauseChannel <- %d", pause)
pauseChannel <- pause
startTime := time.Now()
out, err := dockerExecOut("clickhouse", "bash", "-ce", "LOG_LEVEL=debug clickhouse-backup create --table default.if_not_exists "+testBackupName)
log.Info(out)
if (err != nil && strings.Contains(out, "can't freeze")) || (err == nil && !strings.Contains(out, "can't freeze")) {
if (err != nil && (strings.Contains(out, "can't freeze") || strings.Contains(out, "no tables for backup"))) ||
(err == nil && !strings.Contains(out, "can't freeze")) {
parseTime := func(line string) time.Time {
parsedTime, err := time.Parse("2006/01/02 15:04:05.999999", line[:26])
if err != nil {
Expand Down Expand Up @@ -1465,6 +1467,7 @@ func TestSkipNotExistsTable(t *testing.T) {
wg.Done()
}()
for pause := range pauseChannel {
log.Infof("%d <- pauseChannel", pause)
if pause > 0 {
pauseStart := time.Now()
time.Sleep(time.Duration(pause) * time.Nanosecond)
Expand Down

0 comments on commit b0df795

Please sign in to comment.