@@ -181,7 +181,7 @@ func CreateDocker(
181
181
volumesDir = filepath .Join (pwd , volumesDir )
182
182
}
183
183
maybePanic (os .MkdirAll (volumesDir , 0755 ))
184
- log .Infof (ctx , "cluster volume directory: %s" , volumesDir )
184
+ log .Dev . Infof (ctx , "cluster volume directory: %s" , volumesDir )
185
185
186
186
return & DockerCluster {
187
187
clusterID : clusterIDS ,
@@ -281,7 +281,7 @@ func (l *DockerCluster) createNetwork(ctx context.Context) {
281
281
l .panicOnStop ()
282
282
283
283
l .networkName = fmt .Sprintf ("%s-%s" , networkPrefix , l .clusterID )
284
- log .Infof (ctx , "creating docker network with name: %s" , l .networkName )
284
+ log .Dev . Infof (ctx , "creating docker network with name: %s" , l .networkName )
285
285
net , err := l .client .NetworkInspect (ctx , l .networkName , types.NetworkInspectOptions {})
286
286
if err == nil {
287
287
// We need to destroy the network and any running containers inside of it.
@@ -313,7 +313,7 @@ func (l *DockerCluster) createNetwork(ctx context.Context) {
313
313
func (l * DockerCluster ) initCluster (ctx context.Context ) {
314
314
configJSON , err := json .Marshal (l .config )
315
315
maybePanic (err )
316
- log .Infof (ctx , "Initializing Cluster %s:\n %s" , l .config .Name , configJSON )
316
+ log .Dev . Infof (ctx , "Initializing Cluster %s:\n %s" , l .config .Name , configJSON )
317
317
l .panicOnStop ()
318
318
319
319
pwd , err := os .Getwd ()
@@ -417,7 +417,7 @@ func (l *DockerCluster) createRoach(
417
417
if node .index >= 0 {
418
418
hostname = fmt .Sprintf ("roach-%s-%d" , l .clusterID , node .index )
419
419
}
420
- log .Infof (ctx , "creating docker container with name: %s" , hostname )
420
+ log .Dev . Infof (ctx , "creating docker container with name: %s" , hostname )
421
421
var err error
422
422
node .Container , err = createContainer (
423
423
ctx ,
@@ -516,7 +516,7 @@ func (l *DockerCluster) startNode(ctx context.Context, node *testNode, singleNod
516
516
maybePanic (node .Start (ctx ))
517
517
httpAddr := node .Addr (ctx , defaultHTTP )
518
518
519
- log .Infof (ctx , `*** started %[1]s ***
519
+ log .Dev . Infof (ctx , `*** started %[1]s ***
520
520
ui: %[2]s
521
521
trace: %[2]s/debug/requests
522
522
logs: %[3]s/cockroach.INFO
@@ -551,10 +551,10 @@ func (l *DockerCluster) RunInitCommand(ctx context.Context, nodeIdx int) {
551
551
},
552
552
}
553
553
554
- log .Infof (ctx , "trying to initialize via %v" , containerConfig .Cmd )
554
+ log .Dev . Infof (ctx , "trying to initialize via %v" , containerConfig .Cmd )
555
555
maybePanic (l .OneShot (ctx , defaultImage , types.ImagePullOptions {},
556
556
containerConfig , container.HostConfig {}, platforms .DefaultSpec (), "init-command-" + randomID ))
557
- log .Info (ctx , "cluster successfully initialized" )
557
+ log .Dev . Info (ctx , "cluster successfully initialized" )
558
558
}
559
559
560
560
// returns false is the event
@@ -564,12 +564,12 @@ func (l *DockerCluster) processEvent(ctx context.Context, event events.Message)
564
564
565
565
// Logging everything we get from Docker in service of finding the root
566
566
// cause of #58955.
567
- log .Infof (ctx , "processing event from Docker: %+v" , event )
567
+ log .Dev . Infof (ctx , "processing event from Docker: %+v" , event )
568
568
569
569
// If there's currently a oneshot container, ignore any die messages from
570
570
// it because those are expected.
571
571
if l .oneshot != nil && event .ID == l .oneshot .id && event .Status == eventDie {
572
- log .Infof (ctx , "Docker event was: the oneshot container terminated" )
572
+ log .Dev . Infof (ctx , "Docker event was: the oneshot container terminated" )
573
573
return true
574
574
}
575
575
@@ -587,7 +587,7 @@ func (l *DockerCluster) processEvent(ctx context.Context, event events.Message)
587
587
}
588
588
}
589
589
590
- log .Infof (ctx , "received docker event for unrecognized container: %+v" ,
590
+ log .Dev . Infof (ctx , "received docker event for unrecognized container: %+v" ,
591
591
event )
592
592
593
593
// An event on any other container is unexpected. Die.
@@ -604,7 +604,7 @@ func (l *DockerCluster) processEvent(ctx context.Context, event events.Message)
604
604
}); err == nil {
605
605
defer rc .Close ()
606
606
if _ , err := io .Copy (os .Stderr , rc ); err != nil {
607
- log .Infof (ctx , "error listing logs: %s" , err )
607
+ log .Dev . Infof (ctx , "error listing logs: %s" , err )
608
608
}
609
609
}
610
610
}
@@ -615,8 +615,8 @@ func (l *DockerCluster) monitor(ctx context.Context, monitorDone chan struct{})
615
615
defer close (monitorDone )
616
616
617
617
if log .V (1 ) {
618
- log .Infof (ctx , "events monitor starts" )
619
- defer log .Infof (ctx , "events monitor exits" )
618
+ log .Dev . Infof (ctx , "events monitor starts" )
619
+ defer log .Dev . Infof (ctx , "events monitor exits" )
620
620
}
621
621
longPoll := func () bool {
622
622
// If our context was canceled, it's time to go home.
@@ -632,10 +632,10 @@ func (l *DockerCluster) monitor(ctx context.Context, monitorDone chan struct{})
632
632
for {
633
633
select {
634
634
case <- l .monitorCtx .Done ():
635
- log .Infof (ctx , "monitor shutting down" )
635
+ log .Dev . Infof (ctx , "monitor shutting down" )
636
636
return false
637
637
case err := <- errq :
638
- log .Infof (ctx , "event stream done, resetting...: %s" , err )
638
+ log .Dev . Infof (ctx , "event stream done, resetting...: %s" , err )
639
639
// Sometimes we get a random string-wrapped EOF error back.
640
640
// Hard to assert on, so we just let this goroutine spin.
641
641
return true
@@ -666,10 +666,10 @@ func (l *DockerCluster) Start(ctx context.Context) {
666
666
667
667
l .createNetwork (ctx )
668
668
l .initCluster (ctx )
669
- log .Infof (ctx , "creating node certs (%dbit) in: %s" , keyLen , certsDir )
669
+ log .Dev . Infof (ctx , "creating node certs (%dbit) in: %s" , keyLen , certsDir )
670
670
l .createNodeCerts ()
671
671
672
- log .Infof (ctx , "starting %d nodes" , len (l .Nodes ))
672
+ log .Dev . Infof (ctx , "starting %d nodes" , len (l .Nodes ))
673
673
l .monitorCtx , l .monitorCtxCancelFunc = context .WithCancel (context .Background ())
674
674
l .monitorDone = make (chan struct {})
675
675
go l .monitor (ctx , l .monitorDone )
@@ -730,7 +730,7 @@ func (l *DockerCluster) Assert(ctx context.Context, t testing.TB) {
730
730
t .Fatalf ("unexpected extra event %v (after %v)" , cur , events )
731
731
}
732
732
if log .V (2 ) {
733
- log .Infof (ctx , "asserted %v" , events )
733
+ log .Dev . Infof (ctx , "asserted %v" , events )
734
734
}
735
735
}
736
736
@@ -744,11 +744,11 @@ func (l *DockerCluster) AssertAndStop(ctx context.Context, t testing.TB) {
744
744
// stop stops the cluster.
745
745
func (l * DockerCluster ) stop (ctx context.Context ) {
746
746
if * waitOnStop {
747
- log .Infof (ctx , "waiting for interrupt" )
747
+ log .Dev . Infof (ctx , "waiting for interrupt" )
748
748
<- l .stopper .ShouldQuiesce ()
749
749
}
750
750
751
- log .Infof (ctx , "stopping" )
751
+ log .Dev . Infof (ctx , "stopping" )
752
752
753
753
l .mu .Lock ()
754
754
defer l .mu .Unlock ()
@@ -778,9 +778,9 @@ func (l *DockerCluster) stop(ctx context.Context) {
778
778
defer w .Close ()
779
779
maybePanic (n .Logs (ctx , w ))
780
780
}()
781
- log .Infof (ctx , "node %d: stderr at %s" , i , file )
781
+ log .Dev . Infof (ctx , "node %d: stderr at %s" , i , file )
782
782
if crashed {
783
- log .Infof (ctx , "~~~ node %d CRASHED ~~~~" , i )
783
+ log .Dev . Infof (ctx , "~~~ node %d CRASHED ~~~~" , i )
784
784
}
785
785
maybePanic (n .Remove (ctx ))
786
786
n .Container = nil
@@ -925,7 +925,7 @@ func (l *DockerCluster) Cleanup(ctx context.Context, preserveLogs bool) {
925
925
}
926
926
for _ , v := range volumes {
927
927
if preserveLogs && v .Name () == "logs" {
928
- log .Infof (ctx , "preserving log directory: %s" , l .volumesDir )
928
+ log .Dev . Infof (ctx , "preserving log directory: %s" , l .volumesDir )
929
929
continue
930
930
}
931
931
if err := os .RemoveAll (filepath .Join (l .volumesDir , v .Name ())); err != nil {
0 commit comments