Highlighted
Absent Member.. Absent Member..
Absent Member..
290 views

Timeout running testset using OTA api

Hi

 

I have written a program that will using the ALM OTA Api start an execution of a test set and then download the result and convert it to HTML report.  This works fine in most cases but when a test set contains a test that takes longer than ALM disconnect timeout the execution of the test will finish but ALM marks the test as "Not compeleted" with execution time set to 0.

 

My code looks something like this

 

In my testsetrunner class I first get the testset from alm, then wait for it to complete. On the next call to GetTestSet after the run I get exception that ALM connection timed out.

var testset = _repository.GetTestSet(ts.Id);

_repository.StartExecutionAndWaitForComplete(ts.Id);

var afterRunTestSet = _repository.GetTestSet(ts.Id);

 

public void StartExecutionAndWaitForComplete(int id)

{

var testSetFactory = ALM().TestSetFactory;

var testset = testSetFactory[id];

_scheduler = testset.StartExecution("");

_scheduler.RunAllLocally = true;

_scheduler.Run();

var execstatus = _scheduler.ExecutionStatus;

var finished = false;

while (!finished)

{

execstatus.RefreshExecStatusInfo("all", true);

finished = execstatus.Finished();

 

ALM().RefreshConnectionState();

Thread.Sleep(5000);

}

}

 

// And the ALM function looks like this

private TDConnection ALM()

{

if (_alm == null)

{

_alm = new TDConnection();

}

_alm.RefreshConnectionState();

if (!_alm.Connected)

{

_alm.InitConnectionEx(GetUrl());

}

if (!_alm.LoggedIn)

{

_alm.ConnectProjectEx(DataStorage.Instance.ParameterDomain, DataStorage.Instance.ParameterProject,

DataStorage.Instance.ParameterUser, DataStorage.Instance.ParameterPassword);

}

return _alm;

}

 

 

0 Likes
4 Replies
Highlighted
Cadet 2nd Class Cadet 2nd Class
Cadet 2nd Class

Hi,

 

Could you tell us what version and patch level of ALM are you running?

HP QC Support Engineer
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

hi

 

HP Application Lifecycle Management

Product version 11.52.496 Patch level 2

 

But I have also tried in our next version which is 

Product version: 12.20

Build: 3424
 
And both have the same issue
0 Likes
Highlighted
Commodore
Commodore

Hi,

 

You need to change the EAIT_BEFORE_DISCONNECT to a higher time. It's the only way to avoid the issue.

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Ok, thanks.. That is unfortunate though since we have it low for a reason

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.