alttester / AltTester-Unity-SDK

AltTester Unity SDK is an open-source UI driven test automation tool that helps you find objects in your game and interacts with them using tests written in C#, Python, Robot or Java.
https://alttester.com/docs/sdk/latest/home.html
GNU General Public License v3.0
63 stars 8 forks source link

A Stack Overflow error is triggered when a comand has a large response #1282

Closed MihaiCuc98 closed 11 months ago

MihaiCuc98 commented 1 year ago

When a command returns a large response a StackOverflow error is thrown.

Steps to reproduce

  1. Call a few GetPNGScreenshot commands in your script.
  2. Run the script.

Actual result

The Stack Overflow error is triggered when the GetPNGScreenshot method is reached.

Expected result

There should be no errors when a command with a large response is executed.

sandraaltom commented 1 year ago

Based on the discussions with @RobertPoienar & @robert-altom and the conclusions from https://github.com/alttester/AltTester-Desktop/issues/1102, we are moving this ticket for the next release.

MihaiCuc98 commented 1 year ago

more info: https://altom.slack.com/archives/C0107GMSL0P/p1686309821078599

sandraaltom commented 11 months ago

@robert-altom Based on our Status call today, we decided:

robert-altom commented 11 months ago

@robert-altom Based on our Status call today, we decided:

* to catch the exception and throw a better answer (for the elements to say that the hierarchy is too big and that it is needed to be smaller) and in case of the images to resize it to half

As a temporary fix I upgraded to AltWebSocketSharp v1.0.7 (https://github.com/alttester/alt-websocket-sharp/releases/tag/V1.0.7). This version fixes the Stack Overflow error, but it brakes the closes codes and reason on the Server side. So for now we are gonna use the v1.0.7 for the Drivers and v1.0.0 for the Server.

MihaiCuc98 commented 11 months ago

The testing session is done.

Testing setup:

What was checked:

✔ Checked if no error is triggered when the getPNGScreenshot methods are called in one test multiple times (~ 10 calls one after another) ✔ Checked if the screenshots are successfully created at the specified path

❗ All the above checks were performed using: Unity Runner(.net ), dotnet bindings (.net 7), python project, java bindings ❗ The maximum dimensions of screenshots based on the game tested:

Considering this information, I will close this ticket.