Skip to content

Commit

Permalink
[VEP4, phase1] fix flags in tests in endtoend/worker and strings in…
Browse files Browse the repository at this point in the history
… `go/trace` (#9931)

* [endtoend/worker] fix flags in tests

Signed-off-by: Andrew Mason <andrew@planetscale.com>

* [trace] fix flags in log messages

Signed-off-by: Andrew Mason <andrew@planetscale.com>
  • Loading branch information
Andrew Mason committed Mar 21, 2022
1 parent df2d804 commit a7f7676
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
24 changes: 12 additions & 12 deletions go/test/endtoend/worker/worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ import (
"testing"
"time"

"vitess.io/vitess/go/test/endtoend/sharding"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"vitess.io/vitess/go/json2"
"vitess.io/vitess/go/test/endtoend/cluster"
"vitess.io/vitess/go/test/endtoend/sharding"

topodatapb "vitess.io/vitess/go/vt/proto/topodata"
)

Expand All @@ -63,7 +63,7 @@ var (
shard1Tablets []*cluster.Vttablet
workerTestOffset = 0
commonTabletArg = []string{
"-binlog_use_v3_resharding_mode=true"}
"--binlog_use_v3_resharding_mode=true"}
vtWorkerTest = `
create table worker_test (
id bigint unsigned,
Expand Down Expand Up @@ -304,11 +304,11 @@ func verifySuccessfulWorkerCopyWithReparent(t *testing.T, isMysqlDown bool) {
}

// Reparent away from the old primaries.
localCluster.VtctlclientProcess.ExecuteCommand("PlannedReparentShard", "-keyspace_shard",
"test_keyspace/-80", "-new_primary", shard0Replica.Alias)
localCluster.VtctlclientProcess.ExecuteCommand("PlannedReparentShard", "--", "--keyspace_shard",
"test_keyspace/-80", "--new_primary", shard0Replica.Alias)

localCluster.VtctlclientProcess.ExecuteCommand("PlannedReparentShard", "-keyspace_shard",
"test_keyspace/80-", "-new_primary", shard1Replica.Alias)
localCluster.VtctlclientProcess.ExecuteCommand("PlannedReparentShard", "--", "--keyspace_shard",
"test_keyspace/80-", "--new_primary", shard1Replica.Alias)

proc.Wait()

Expand All @@ -321,9 +321,9 @@ func verifySuccessfulWorkerCopyWithReparent(t *testing.T, isMysqlDown bool) {
cluster.WaitForReplicationPos(t, shard0Replica, shard0RdOnly1, "localhost", 60)
cluster.WaitForReplicationPos(t, shard1Replica, shard1RdOnly1, "localhost", 60)

err = localCluster.VtworkerProcess.ExecuteVtworkerCommand(localCluster.GetAndReservePort(), localCluster.GetAndReservePort(), "-cell", cell,
err = localCluster.VtworkerProcess.ExecuteVtworkerCommand(localCluster.GetAndReservePort(), localCluster.GetAndReservePort(), "--cell", cell,
"--use_v3_resharding_mode=true",
"SplitClone",
"SplitClone", "--",
"--online=false",
"--min_healthy_rdonly_tablets", "1",
"test_keyspace/0")
Expand Down Expand Up @@ -362,9 +362,9 @@ func runSplitDiff(t *testing.T, keyspaceShard string) {

err := localCluster.VtworkerProcess.ExecuteVtworkerCommand(localCluster.GetAndReservePort(),
localCluster.GetAndReservePort(),
"-cell", cell,
"--cell", cell,
"--use_v3_resharding_mode=true",
"SplitDiff",
"SplitDiff", "--",
"--min_healthy_rdonly_tablets", "1",
keyspaceShard)
assert.Nil(t, err)
Expand Down Expand Up @@ -526,7 +526,7 @@ func runShardTablets(t *testing.T, shardName string, tabletArr []*cluster.Vttabl

func copySchemaToDestinationShard(t *testing.T) {
for _, keyspaceShard := range []string{"test_keyspace/-80", "test_keyspace/80-"} {
err := localCluster.VtctlclientProcess.ExecuteCommand("CopySchemaShard", "--exclude_tables", "unrelated", "test_keyspace/0", keyspaceShard)
err := localCluster.VtctlclientProcess.ExecuteCommand("CopySchemaShard", "--", "--exclude_tables", "unrelated", "test_keyspace/0", keyspaceShard)
assert.Nil(t, err)
}
}
Expand Down
4 changes: 2 additions & 2 deletions go/trace/plugin_jaeger.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func newJagerTracerFromEnv(serviceName string) (tracingService, io.Closer, error
if samplingType.IsSet() {
cfg.Sampler.Type = samplingType.Get()
} else if cfg.Sampler.Type == "" {
log.Infof("-tracing-sampler-type was not set, and JAEGER_SAMPLER_TYPE was not set, defaulting to const sampler")
log.Infof("--tracing-sampler-type was not set, and JAEGER_SAMPLER_TYPE was not set, defaulting to const sampler")
cfg.Sampler.Type = jaeger.SamplerTypeConst
}

Expand All @@ -102,7 +102,7 @@ func newJagerTracerFromEnv(serviceName string) (tracingService, io.Closer, error
if *enableLogging {
opts = append(opts, config.Logger(&traceLogger{}))
} else if cfg.Reporter.LogSpans {
log.Warningf("JAEGER_REPORTER_LOG_SPANS was set, but -tracing-enable-logging was not; spans will not be logged")
log.Warningf("JAEGER_REPORTER_LOG_SPANS was set, but --tracing-enable-logging was not; spans will not be logged")
}

tracer, closer, err := cfg.NewTracer(opts...)
Expand Down

0 comments on commit a7f7676

Please sign in to comment.