This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch fix/cdutz/reenable-golang-driver-testsuites
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit 1fc5bfc3117c5c97c68d4e7aab4f3d7a898bd76c
Author: Christofer Dutz <[email protected]>
AuthorDate: Thu Feb 23 23:19:12 2023 +0100

    chore(driver/eip): Changed the testsuite runner to output the data, even if 
there's too little.
---
 plc4go/spi/testutils/DriverTestRunner.go | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/plc4go/spi/testutils/DriverTestRunner.go 
b/plc4go/spi/testutils/DriverTestRunner.go
index ea2c286b3b..077bbfff29 100644
--- a/plc4go/spi/testutils/DriverTestRunner.go
+++ b/plc4go/spi/testutils/DriverTestRunner.go
@@ -302,7 +302,10 @@ func (m DriverTestsuite) ExecuteStep(connection 
plc4go.PlcConnection, testcase *
                log.Trace().Uint32("expectedRawOutputLength", 
expectedRawOutputLength).Msg("Reading bytes")
                for testTransportInstance.GetNumDrainableBytes() < 
expectedRawOutputLength {
                        if time.Now().Sub(now) > 2*time.Second {
-                               return errors.Errorf("error getting bytes from 
transport. Not enough data available: actual(%d)<expected(%d)", 
testTransportInstance.GetNumDrainableBytes(), expectedRawOutputLength)
+                               drainableBytes := 
testTransportInstance.GetNumDrainableBytes()
+                               actualRawOutput, _ := 
testTransportInstance.DrainWriteBuffer(drainableBytes)
+                               return errors.Errorf("error getting bytes from 
transport. Not enough data available: actual(%d)<expected(%d), \nactual:   
0x%X\nexpected: 0x%X\nHexdumps:\n%s",
+                                       drainableBytes, 
expectedRawOutputLength, actualRawOutput, expectedRawOutput, 
utils.DiffHex(actualRawOutput, expectedRawOutput))
                        }
                        time.Sleep(10 * time.Millisecond)
                }

Reply via email to