1

Note: I am aware that this topic is broad and maybe subjective, however, I do not know any better place to ask. If you close it, please tell me where I could ask instead.

Assuming we are running a fully automated system-test, we often have to wait for asynchronous tasks, such as installation, computation or response from web. If tests are run in the cloud, the execution time is influenced by the current workload of the cloud as well as other factors.

What do we want ideally? Success: We move on immediately to the next step of testing -> not the topic of this post. Failure: We want the test to wait until an obvious error occurs or until a maximum timeout is reached, because deadlocks are possible. For some cases, (e.g. network not available) we would like to retry the task for a couple of times. Implementations of the maximum time and the retry step are relatively straight forward. I am struggling with the obvious error case and therefore that is topic here.

Why is maximum time and number of retries not enough? Let's assume the following scenario: an automated system-test is verifying that a computation results in a certain result. The run-time could increase with a new update, vary due to test data size or workload of the cloud. If we simply set a maximum timeout, the test fails because the timeout is reached even though computation is ongoing. If the computation fails completely, the test might run for hours, because the timeout is not reached, yet. It is important to keep low execution time and feedback direct.

What is best practice here? Is it a good idea to check something like "does it look like the process is still running?" in addition to the regular "did it finish successfully?". Is analyzing logs or events the way to go? Any expertise on this topic would be welcome and helpful.

1 Answer 1

1

Actually that's a great question, although in most test systems I have worked with this stage came last as a reaction to problems happening and not as a solid design.

"does it look like the process is still running?"

Sure why not ? you can extend it to actual fully fledged monitoring, for example using monit on Linux, then you can monitor not just the processing process but also the test infrastructure itself, for example is the network share connected ? is the DB up ? do I have enough memory and CPU available ?

Is analyzing logs or events the way to go?

I had a secret plan to utilize this for post processing of results, but analyzing the system as it runs is the way to go if you can afford the complexity and processing load.

In the extreme you can use AI/ML and identify problems not based on hard coded rules but on past experience and results, although I doubt this is feasible for most projects.

run-time could increase with a new update, vary due to test data size or workload of the cloud

That is actually a bug in your tests, you should be able to asses how much time is needed and adjust the timeout accordingly. If you collect enough data about your tests (CPU load, memory consumed or available, file size, needed processing etc.) you can build a model that will help you predict the necessary timeout and even adjust it as you go.

2
  • Thanks for your feedback. My current project is in C# under windows so I can't test monit. Regarding the assessment of computing time: I have no clue how to asses that in practice. For example: how can I estimate that (while my test is running) workload in the cloud increases and my timeout should increase accordingly? Jun 19, 2019 at 9:31
  • possible monit replacement, or write your own script. It's hard to asses the relationship, but you could measure CPU load, File system load and memory VS processing time and then build a model out of that. A model could be as simple as using (google that) a "polynomial approximation calculator". I'm not saying it's easy but certainly doable
    – Rsf
    Jun 19, 2019 at 9:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.