How to run a script only when a license is available

We would like to create a script that will test if there is an execute license available before releasing a job from our job queue.

Typically any connection info is encapsulated within the data that is read by the submitted job thus allowing it to repeat the series of tests against multiple SUTs. However this also means that all jobs are initially started from the machine that EggPlant is installed on.

So, if we have 5 execute licenses we would like to be able to release the first 5 jobs from the job queue then not release another until one of those original 5 has completed.

Our plan was to create a dummy script that updated a file, submit it using the shell command and if the file was updated then submit the real job. Loop round and repeat the process.

But foiled! The shell command seems to wait until the job has completed before returning to the initiating script. This is OK for the dummy script but not for the real script as obviously we can only run one job at a time.

Tried terminating the shell command with & to fork the process and then ‘exit’ to quit the shell but it still runs serially.

Is there any other method in SenseTalk or a shell script to just submit a job then immediatly return to the calling script without waiting for the process to end so that other processes can be created??

I don’t know if you ever found a way to do this. I did spend some time on this and couldn’t find a solution. One of the problems – if I understand what you are trying to do correctly – is that the license is not explicitly released when the script ends or the app quits; there is a license server process that releases the license if the application hasn’t asked to use it for some interval of time. That means that you could run a script successfully from the command line, then immediately try to run another one and get an error message because the license is still sort of “reserved” by the previous run.

How long is this timeout interval and is the value configurable?

The only other method I have come up with is to use two libraries. The user places their job in a common library for execution. Our scheduler counts the number of jobs in an ‘executing’ library. If the count is less than the number of licenses then a new job from the common library is moved to the executable library and submitted to TestPlant etc. etc.

Unfortunately, the timeout value is not configurable.

We’ve been giving some thought to this situation and as Matt said there really isn’t a good solution for this situation currently.

I think your two-phase architecture is a good approach.