Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Using Perl API to get Step Logs and write to a file

I am trying to get results from a step using the perl api. It appears
to be timing out, as it fails after about 300 seconds.

This is the portion of the Perl code that is failing. It is supposed
to take a build tag and return the results of the build step. It works
for smaller logs, but this one is several thousand lines and it appears
to be timing out.

my $build_id = shift;

my $i=0;
while (defined($builds->{startTime})) {
if($builds->{tag} eq $build_id )
{
my $results = $builds->getResults(); # get results for each
step
# For each step, check to see if it failed.
my $step_num = 0;
while( defined($results->) )
{
if( $results->->{description} =~ 'Build' || $results->
->{description} =~ 'build' )
{
# Open file with name build_tag.txt
my $fname = $builds->{tag}.".txt";
if(! -e $fname)
{
open OUTFILE, "> $fname", or die "Can't open $fname : $!";
my $log = $results->->getLogs(); ####FAILS

Buildforge version is 7.1.2.2-1-0111.

0 votes



One answer

Permanent link
I am trying to get results from a step using the perl api. It appears
to be timing out, as it fails after about 300 seconds.

This is the portion of the Perl code that is failing. It is supposed
to take a build tag and return the results of the build step. It works
for smaller logs, but this one is several thousand lines and it appears
to be timing out.

my $build_id = shift;

my $i=0;
while (defined($builds->{startTime})) {
if($builds->{tag} eq $build_id )
{
my $results = $builds->getResults(); # get results for each
step
# For each step, check to see if it failed.
my $step_num = 0;
while( defined($results->) )
{
if( $results->->{description} =~ 'Build' || $results->
->{description} =~ 'build' )
{
# Open file with name build_tag.txt
my $fname = $builds->{tag}.".txt";
if(! -e $fname)
{
open OUTFILE, "> $fname", or die "Can't open $fname : $!";
my $log = $results->->getLogs(); ####FAILS

Buildforge version is 7.1.2.2-1-0111.


Hi Ray,

What does the error message that you get look like?

Brent Ulbricht
RTC Build Lead

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Aug 05 '11, 1:01 p.m.

Question was seen: 4,831 times

Last updated: Aug 05 '11, 1:01 p.m.

Confirmation Cancel Confirm