Skip to content

Commit

Permalink
[RSDK-9149] Fix Logger Test Fails (#4723)
Browse files Browse the repository at this point in the history
  • Loading branch information
bashar-515 authored Jan 22, 2025
1 parent 93970a5 commit 36db2d2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ require (
go.uber.org/zap v1.27.0
go.viam.com/api v0.1.380
go.viam.com/test v1.2.4
go.viam.com/utils v0.1.123
go.viam.com/utils v0.1.126
goji.io v2.0.2+incompatible
golang.org/x/image v0.19.0
golang.org/x/mobile v0.0.0-20240112133503-c713f31d574b
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1517,8 +1517,8 @@ go.viam.com/api v0.1.380 h1:VgRHDlPBku+kjIp4omxmPNmRVZezytFUUOFJ2xpRFR8=
go.viam.com/api v0.1.380/go.mod h1:g5eipXHNm0rQmW7DWya6avKcmzoypLmxnMlAaIsE5Ls=
go.viam.com/test v1.2.4 h1:JYgZhsuGAQ8sL9jWkziAXN9VJJiKbjoi9BsO33TW3ug=
go.viam.com/test v1.2.4/go.mod h1:zI2xzosHdqXAJ/kFqcN+OIF78kQuTV2nIhGZ8EzvaJI=
go.viam.com/utils v0.1.123 h1:0nxG3Rp9MmFn+qFbPQ4qSptz+hvm9MENbPXvKUBgRqU=
go.viam.com/utils v0.1.123/go.mod h1:g1CaEkf7aJCrSI/Sfkx+6cBS1+Y3fPT2pvMQbp7TTBI=
go.viam.com/utils v0.1.126 h1:ecFlzln5/u1NqzVMOVxwgwbkg4dDWvQmcCS2fMg0ZNU=
go.viam.com/utils v0.1.126/go.mod h1:g1CaEkf7aJCrSI/Sfkx+6cBS1+Y3fPT2pvMQbp7TTBI=
go4.org/unsafe/assume-no-moving-gc v0.0.0-20230525183740-e7c30c78aeb2 h1:WJhcL4p+YeDxmZWg141nRm7XC8IDmhz7lk5GpadO1Sg=
go4.org/unsafe/assume-no-moving-gc v0.0.0-20230525183740-e7c30c78aeb2/go.mod h1:FftLjUGFEDu5k8lt0ddY+HcrH/qU/0qk+H8j9/nTl3E=
gocv.io/x/gocv v0.25.0/go.mod h1:Rar2PS6DV+T4FL+PM535EImD/h13hGVaHhnCu1xarBs=
Expand Down
11 changes: 1 addition & 10 deletions robot/impl/resource_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/jhump/protoreflect/desc"
"github.com/jhump/protoreflect/grpcreflect"
"go.mongodb.org/mongo-driver/bson/primitive"
"go.uber.org/zap/zapcore"
armpb "go.viam.com/api/component/arm/v1"
basepb "go.viam.com/api/component/base/v1"
boardpb "go.viam.com/api/component/board/v1"
Expand Down Expand Up @@ -1581,7 +1580,7 @@ func TestReconfigure(t *testing.T) {
}

func TestRemoteConnClosedOnReconfigure(t *testing.T) {
logger, observer := logging.NewObservedTestLogger(t)
logger := logging.NewTestLogger(t)

ctx := context.Background()

Expand Down Expand Up @@ -1679,10 +1678,6 @@ func TestRemoteConnClosedOnReconfigure(t *testing.T) {
test.That(t, err, test.ShouldBeNil)
test.That(t, moving, test.ShouldBeFalse)
test.That(t, speed, test.ShouldEqual, 0.0)

// Also check that there are no error logs associated with the main robot trying to reconnect to remote2
// Leaked remote connections will cause the test to fail due to goroutine leaks
test.That(t, observer.FilterLevelExact(zapcore.ErrorLevel).Len(), test.ShouldEqual, 0)
})

t.Run("remotes with different resources", func(t *testing.T) {
Expand Down Expand Up @@ -1755,10 +1750,6 @@ func TestRemoteConnClosedOnReconfigure(t *testing.T) {
moving, err = arm1.IsMoving(ctx)
test.That(t, err, test.ShouldBeNil)
test.That(t, moving, test.ShouldBeFalse)

// Also check that there are no error logs associated with the main robot trying to reconnect to remote2
// Leaked remote connections will cause the test to fail due to goroutine leaks
test.That(t, observer.FilterLevelExact(zapcore.ErrorLevel).Len(), test.ShouldEqual, 0)
})
}

Expand Down

0 comments on commit 36db2d2

Please sign in to comment.