Project

General

Profile

Actions

action #1308

closed

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

Added by aplanas almost 11 years ago. Updated almost 10 years ago.

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

0%

Estimated time:

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)

Actions #1

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).

Actions #2

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?

Actions #3

Updated by ancorgs over 10 years ago

  • Priority changed from Normal to High
Actions #4

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
Actions #5

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

Actions #6

Updated by coolo almost 10 years ago

  • Assignee set to coolo
  • Target version set to Sprint 12
Actions #7

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!

Actions #8

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 :)

Actions

Also available in: Atom PDF