action #1308
closedEvaluate the creation of an event loop in the os-autoinst to communicate as a service
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)
Updated by ancorgs almost 11 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).
Updated by aplanas almost 11 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?
Updated by lnussel over 10 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
Updated by coolo almost 10 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
Updated by coolo almost 10 years ago
- Assignee set to coolo
- Target version set to Sprint 12
Updated by coolo almost 10 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!
Updated by coolo almost 10 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 :)