From cf04692ac20a815ea8b46f93e061c98efda27179 Mon Sep 17 00:00:00 2001 From: piepor <28514575-piepor@users.noreply.gitlab.com> Date: Thu, 25 Jun 2026 15:44:20 +0200 Subject: [PATCH] test: add error check after cacheOp.Exec Previously the test did not check if the cacheOp.Execute(ctx, errCh) function produced an error: this could lead to panic failure during tests execution. Now the failure is managed requiring that the function did not produce any error on the error channel Signed-off-by: piepor <28514575-piepor@users.noreply.gitlab.com> --- internal/topo/node/cache_op_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/topo/node/cache_op_test.go b/internal/topo/node/cache_op_test.go index f5617d061a..1d18da78ef 100644 --- a/internal/topo/node/cache_op_test.go +++ b/internal/topo/node/cache_op_test.go @@ -23,6 +23,7 @@ import ( "time" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "github.com/lf-edge/ekuiper/v2/internal/conf" "github.com/lf-edge/ekuiper/v2/internal/pkg/def" @@ -119,6 +120,11 @@ func TestCacheRun(t *testing.T) { index := 0 errCh := make(chan error) cacheOp.Exec(ctx, errCh) + select { + case err := <-errCh: + require.NoError(t, err) + case <-time.After(100 * time.Millisecond): + } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { var r any