Sign In Register

How can we help you today?

Start a new topic

idling when testing in Test Harness

I never had problem there before, but the test harness debugging now seems like taking a while to do anything...

It is now idling all the time, with longest time (about 10 minutes) when stepping over a require() instruction (those required modules contain only functions, nothing immediately executable).

I'm using the "preview" service, and I know my internet connection is not awesome. It never has been more than a marginal issue however.

Also, the response time is still quite fast and normal when all debugs are un-checked and only the response is shown.


Could it be related to the last platform Release 4 days ago? I haven't used the test harness extensively since then.


I'll try again tomorrow and let you know how things are.


Things are at the same point. It is almost impossible for me to debug substantial cloud code.

It only works when testing a few lines in an otherwise empty event.

Hi Gabriel,


We'll look into this for you. When you say your internet connection is "not awesome", can you define that ? If you can post the steps to replicate this issue, with your permission I'd like to go into your game follow these same steps and see if I run into the same issues.


Thanks,

Liam

Sure no problem.


I have great bandwidth, but a stable 600-650 ms ping due to having a satellite connection.


If you can get into my game, log as user "abc" with pass "abc" and try debugging the "test" LogEvent. 

Do I need to add you as collaborator or something?



Hi Gabriel,


No that won't be necessary, I'll investigate this and get back to you.


Thanks,

Liam 

Did you managed to reproduce it?

Hi Gabriel,


Yes I did, it's very slow, can you talk me through whats going on in the test event ? 


Thanks,

Liam

Well nothing is going on in this test event:

Spark.setScriptData("done", true);

The slowdown seems to come from the require() on the opening. The many modules of my game each contain multiple functions. Some modules are more concise than others but the biggest have a bit more than 2000 lines. There is also a few constants (var MY_CONSTANT = 32;).

There is many cross requirements for the various modules meaning many modules are "require" multiple time. However you explicitly said somewhere that it was alright to do so.


Accounting for cross requirement, most of my game module are probably included in the test event even if there is only 2 "require". However, except a few constants declaration, no code and none of the functions are executed in this event.

I'm almost ready to go into beta and this is quite a paralyzing issue... 

Am I the only one with this problem? Have I done something I shouldn't by regrouping that many functions in modules? 

Still, this was not a problem before, and true Execution time does not seem to be through the roof... I'm puzzled.


Hi Gabriel, 

I've taken a look at your game and ran the test event. The event is very intensive. We would consider anything over 100,000 instructions to be overly intensive for one event. Using a chart(see attached) I discovered your test event was close to 200,000 instructions, while others were even more intensive than that. At first glance,my recommendation would be to use multiple events and spread the load between them. Keeping as close to 100,000 instructions as you can per event. 


Does this clarify things for you? 

I'll look into this further so as to find the best solution. 

Best Regards Patrick. 


chart.png
(132 KB)

Your pasted image refer to script duration, something that is definitely affected by my debugging problem. This data should probably be discarded (I received "long running script error" all the time from previously tested events that I had stopped because they were idling, they apparently keep running in the background until hitting the long running script ceiling, this data is of no interest in this context).


On the subject of the instructions amount per script, I have to say that I admitetly have some long script with many instructions, but "test" is definitely not one of them. Using your chart and looking for my "test" event, i see that it is actually sitting at "0" instructions for the request. Not sure if this is a bug, shouldn't it be at least 1? (Again: no code is executed in the test event, but modules full of uncalled functions are included)


However, instructions amount is most definitely not the problem in this "test" event. It is most probably something about caching the many functions in the debugger for nothing (as they are never called)... I guess.


Anyhow, from where I stand, nothing is clarified. :/


Hi Gabriel, 

Apologies if I have not explained the problem with enough clarity.

I've investigated this further and have some additional insights. 
A short term solution for the test harness timing out is to turn off debugging for that event. The event will then run without hanging as it previously was. 


However, you will have to refactor your code and approach this differently as  your current approach will cause severe instability or timeouts when called by multiple users. For instance here is the execution time for the response of your test event: 

 {
"@class": ".LogEventResponse",
"scriptData": {
"ApproximateExecutionTime_ms": 34681,
"done": true
}

The execution time is far too long and the maximum execution time should be closer to 100 ms rather than the current 34,681ms. 


Could you detail, step by step, how you are implementing these modules and in what order. Unfortunately it seems refactoring will have to be done. We are happy to help where we can in that regard. 

Regards Patrick. 

 

Neither the "test" event nor any other is ever idling when called from users, from Unity, or from the test harness with debugging turned off:

{
 "@class": ".LogEventResponse",
 "scriptData": {
  "ApproximateExecutionTime_ms": 16,
  "done": true
 }
}

 This issue happen only in test harness with debugging turned on. And a few days ago, before the last update, everything was alright in all the events that are now idling (they are idling only in test harness with debugging turned on).


It is quite weird that refactoring of my code needs to be done to make it compatible with the test harness debugger... I would like to know how that can be done anyhow, as debugging properly my cloud code is getting more and more urgent by the day.


As I said, my modules are only collections of functions, there is many of them, but no code and no functions are executed on a require():

ModuleA:

function funcA(parameter1, parameter2) {
    …
}

function funcB(parameter1, parameter2) {
    …
}

function funcC(parameter1) {
    …
}

function funcD(parameter1) {
    …
}

 I hope this time I was more clear on what the issue is.


Hi Gabriel, 

Our dev team is looking into this issue now. We will update you as soon as the situation is resolved. Thanks for your patience. 

Best Regards, Patrick.

Ok! Thank you very much!

Login to post a comment