From 9d660152a3ee7bbea0bbe5cf0aec2e3e9bfabcf5 Mon Sep 17 00:00:00 2001 From: Tess Avitabile Date: Wed, 12 Oct 2022 14:52:13 -0400 Subject: [PATCH 1/2] Fix TestORBSLAMDataProcess timeout --- services/slam/builtin/builtin.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/slam/builtin/builtin.go b/services/slam/builtin/builtin.go index ab76b7c4641..b6ab0a27b23 100644 --- a/services/slam/builtin/builtin.go +++ b/services/slam/builtin/builtin.go @@ -636,6 +636,7 @@ func (slamSvc *builtIn) StartDataProcess( } if c != nil { c <- 1 + c = nil } case slam.Sparse: if _, err := slamSvc.getAndSaveDataSparse(cancelCtx, cams, camStreams); err != nil { @@ -643,6 +644,7 @@ func (slamSvc *builtIn) StartDataProcess( } if c != nil { c <- 1 + c = nil } default: slamSvc.logger.Warnw("warning invalid algorithm specified", "algorithm", slamSvc.slamLib.AlgoType) From b67d9097ee93c4c7204b14de77efe0483f354604 Mon Sep 17 00:00:00 2001 From: Tess Avitabile Date: Wed, 12 Oct 2022 15:15:06 -0400 Subject: [PATCH 2/2] increase channel buffer size instead --- services/slam/builtin/builtin.go | 2 -- services/slam/builtin/builtin_test.go | 8 ++++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/services/slam/builtin/builtin.go b/services/slam/builtin/builtin.go index b6ab0a27b23..ab76b7c4641 100644 --- a/services/slam/builtin/builtin.go +++ b/services/slam/builtin/builtin.go @@ -636,7 +636,6 @@ func (slamSvc *builtIn) StartDataProcess( } if c != nil { c <- 1 - c = nil } case slam.Sparse: if _, err := slamSvc.getAndSaveDataSparse(cancelCtx, cams, camStreams); err != nil { @@ -644,7 +643,6 @@ func (slamSvc *builtIn) StartDataProcess( } if c != nil { c <- 1 - c = nil } default: slamSvc.logger.Warnw("warning invalid algorithm specified", "algorithm", slamSvc.slamLib.AlgoType) diff --git a/services/slam/builtin/builtin_test.go b/services/slam/builtin/builtin_test.go index 9757515f8ef..85dfeb89c31 100644 --- a/services/slam/builtin/builtin_test.go +++ b/services/slam/builtin/builtin_test.go @@ -671,7 +671,7 @@ func TestCartographerDataProcess(t *testing.T) { }() cancelCtx, cancelFunc := context.WithCancel(context.Background()) - c := make(chan int) + c := make(chan int, 100) slamSvc.StartDataProcess(cancelCtx, cams, camStreams, c) <-c @@ -698,7 +698,7 @@ func TestCartographerDataProcess(t *testing.T) { }() cancelCtx, cancelFunc := context.WithCancel(context.Background()) - c := make(chan int) + c := make(chan int, 100) slamSvc.StartDataProcess(cancelCtx, cams, camStreams, c) <-c @@ -764,7 +764,7 @@ func TestORBSLAMDataProcess(t *testing.T) { cancelCtx, cancelFunc := context.WithCancel(context.Background()) - c := make(chan int) + c := make(chan int, 100) slamSvc.StartDataProcess(cancelCtx, cams, camStreams, c) <-c @@ -788,7 +788,7 @@ func TestORBSLAMDataProcess(t *testing.T) { }() cancelCtx, cancelFunc := context.WithCancel(context.Background()) - c := make(chan int) + c := make(chan int, 100) slamSvc.StartDataProcess(cancelCtx, cams, camStreams, c) <-c