Project

General

Profile

action #1308

Evaluate the creation of an event loop in the os-autoinst to communicate as a service

Added by aplanas over 8 years ago. Updated almost 8 years ago.

Status:
Resolved
Priority:
High
Assignee:
Category:
Feature requests
Target version:
Start date:
2014-01-27
Due date:
% Done:

0%

Estimated time:
Difficulty:

Description

os-autoinst is a standalone utility that can be executed by itself. The problem is that once this application is running there is not clear way to modify the behavior (stopping or pausing a test, skipping a test, ...) We need to create a loop event in os-autoinst to accept external commands via a communication channel (socket or directly from a rest protocol)

History

#1 Updated by ancorgs over 8 years ago

Right now, the "signals" are implemented by placing files "in the way" of os-autoinst. Without changing it much, we can have a Mojolicious::Lite script just listening in the same machine that os-autoinst and then converting those proper calls into hacky files. So, for me, "worker" should probably become a Mojolicious::Lite script (just an idea).

#2 Updated by aplanas over 8 years ago

ancorgs wrote:

So, for me, "worker" should probably become a Mojolicious::Lite script (just an idea).

IDK, maybe the solution is to avoid the hacky files and create a proper loop in the os-autoinst part that monitor the channel and affect to the test.

Now is something like this:

[ Worker ] -> [ os-autoinst -> Test ]

Worker is a process and os-autoinst + Test is another process. The loop in os-autoinst take care of run the test in the same process calling the run() function inside the test. So when os-autoinst delegate the execution with the test this can;t control it anymore, except when the test goes out in a waitforneedle.

This lost of controls is IMO the problem, and the solutions are basically a variant of two:

1) Cooperative: Intercept every API that delegate again the control of the test to os-autoinst (sendkey[w], waitforneedle, check_screen, take_screenshot...). Is like a yield in a cooperative multithread env.

2) Preemptive: os-autoins forks the test loop and takes control from outside in a different loop. Basically it can kill, remove and restart the process that contains the tests loop from outside

Any ideas?

#3 Updated by ancorgs over 8 years ago

  • Priority changed from Normal to High

#4 Updated by lnussel over 8 years ago

  • Subject changed from Evaluate the creation of a loop event in the os-autoinst to communicate as a service to Evaluate the creation of an event loop in the os-autoinst to communicate as a service

#5 Updated by coolo almost 8 years ago

  • Category set to 132

it's harder than it sounds as the tests run in the main loop and call "sleep 10" - so we would at least need to overwrite sleep

#6 Updated by coolo almost 8 years ago

  • Assignee set to coolo
  • Target version set to Sprint 12

#7 Updated by coolo almost 8 years ago

telnet localhost 20013
Trying 127.0.0.1...
Connected to localhost.
Escape character is ']'.
GET /
HTTP/1.1 400 Bad Request
Content-Length: 12
Connection: close
Content-Type: text/html;charset=UTF-8
Server: Mojolicious (Perl)
Date: Wed, 26 Nov 2014 12:29:37 GMT

Hello World!

#8 Updated by coolo almost 8 years ago

  • Status changed from New to Resolved

we have a commands thread now - that can set variables from over HTTP. For now only for things coming from localhost though. But it's evaluated :)

Also available in: Atom PDF