You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2023/06/14 11:36:13 UTC
[plc4x] 01/02: test(plc4go/cbus): trace workers on one flaky test
This is an automated email from the ASF dual-hosted git repository.
sruehl pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git
commit de1c69b3ff94e4b557b5409bcdb31d76c53406e8
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Wed Jun 14 13:25:36 2023 +0200
test(plc4go/cbus): trace workers on one flaky test
---
plc4go/internal/cbus/Browser_test.go | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/plc4go/internal/cbus/Browser_test.go b/plc4go/internal/cbus/Browser_test.go
index f89593b75f..e150f04f8f 100644
--- a/plc4go/internal/cbus/Browser_test.go
+++ b/plc4go/internal/cbus/Browser_test.go
@@ -22,6 +22,7 @@ package cbus
import (
"context"
"fmt"
+ "github.com/apache/plc4x/plc4go/spi/pool"
"net/url"
"sync/atomic"
"testing"
@@ -369,12 +370,15 @@ func TestBrowser_getInstalledUnitAddressBytes(t *testing.T) {
// Set the model logger to the logger above
testutils.SetToTestingLogger(t, readWriteModel.Plc4xModelLog)
- // Custom option for that
- loggerOption := options.WithCustomLogger(logger)
+ // Custom options for that
+ _options := []options.WithOption{
+ options.WithCustomLogger(logger),
+ pool.WithExecutorOptionTracerWorkers(true),
+ }
- transport := test.NewTransport(loggerOption)
+ transport := test.NewTransport(_options...)
transportUrl := url.URL{Scheme: "test"}
- transportInstance, err := transport.CreateTransportInstance(transportUrl, nil, loggerOption)
+ transportInstance, err := transport.CreateTransportInstance(transportUrl, nil, _options...)
require.NoError(t, err)
t.Cleanup(func() {
assert.NoError(t, transportInstance.Close())
@@ -431,7 +435,7 @@ func TestBrowser_getInstalledUnitAddressBytes(t *testing.T) {
})
err = transport.AddPreregisteredInstances(transportUrl, transportInstance)
require.NoError(t, err)
- connectionConnectResult := <-NewDriver(loggerOption).GetConnection(transportUrl, map[string]transports.Transport{"test": transport}, map[string][]string{})
+ connectionConnectResult := <-NewDriver(_options...).GetConnection(transportUrl, map[string]transports.Transport{"test": transport}, map[string][]string{})
if err := connectionConnectResult.GetErr(); err != nil {
t.Error(err)
t.FailNow()