log close errors with RecordMessage
This commit is contained in:
parent
eb65f1e441
commit
b1159b657d
@ -4,7 +4,6 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
|
||||||
|
|
||||||
"github.com/testground/sdk-go/sync"
|
"github.com/testground/sdk-go/sync"
|
||||||
|
|
||||||
@ -29,12 +28,9 @@ type PubsubTracerMsg struct {
|
|||||||
Tracer string
|
Tracer string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (tr *PubsubTracer) Stop() {
|
func (tr *PubsubTracer) Stop() error {
|
||||||
tr.traced.Stop()
|
tr.traced.Stop()
|
||||||
err := tr.host.Close()
|
return tr.host.Close()
|
||||||
if err != nil {
|
|
||||||
log.Printf("error closing host: %s", err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func preparePubsubTracer(t *TestEnvironment) (*PubsubTracer, error) {
|
func preparePubsubTracer(t *TestEnvironment) (*PubsubTracer, error) {
|
||||||
@ -83,7 +79,12 @@ func runPubsubTracer(t *TestEnvironment) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
defer tracer.Stop()
|
defer func() {
|
||||||
|
err := tracer.Stop()
|
||||||
|
if err != nil {
|
||||||
|
t.RecordMessage("error stoping tracer: %s", err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
t.SyncClient.MustSignalAndWait(ctx, stateDone, t.TestInstanceCount)
|
t.SyncClient.MustSignalAndWait(ctx, stateDone, t.TestInstanceCount)
|
||||||
|
Loading…
Reference in New Issue
Block a user