Last Comment Bug 533093 - Fix a test exit status bug in runtests.pl when there is no timeout for tests.
: Fix a test exit status bug in runtests.pl when there is no timeout for tests.
Status: RESOLVED FIXED
:
Product: NSPR
Classification: Components
Component: NSPR (show other bugs)
: other
: All All
: -- normal (vote)
: 4.8.3
Assigned To: Wan-Teh Chang
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-12-05 09:57 PST by Wan-Teh Chang
Modified: 2009-12-07 16:53 PST (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Proposed patch (951 bytes, patch)
2009-12-05 09:57 PST, Wan-Teh Chang
christophe.ravel.bugs: review+
Details | Diff | Splinter Review

Description Wan-Teh Chang 2009-12-05 09:57:44 PST
Created attachment 416274 [details] [diff] [review]
Proposed patch

Christophe,

One of the changes you made for bug 462178 in rev. 1.3 of
mozilla/nsprpub/pr/tests/runtests.pl is:

 sub ux_wait_timeout {
 # parameters:
 $lpid = shift;     # child process id
 $ltimeout = shift; # timeout

     if ($ltimeout == 0) {
         # No timeout: use blocking wait
         $ret = waitpid($lpid,0);
         # Exit and don't kill
         $lstatus = $? % 256;
         $ltimeout = -1;
     } else {
         while ($ltimeout > 0) {
             # Check status of child using non blocking wait
             $ret = waitpid($lpid, WNOHANG);
             if ($ret == 0) {
                 # Child still running
     #           print "Time left=$ltimeout\n";
                 sleep 1;
                 $ltimeout--;
             } else {
                 # Child has ended
-                $lstatus = $? % 256;
+                $lstatus = $?;
                 # Exit the wait loop and don't kill
                 $ltimeout = -1;
             }
         }
     }

We need the same change for the if ($ltimeout == 0) case.
Please review the attached patch.  Thanks!
Comment 1 Christophe Ravel 2009-12-07 10:06:38 PST
Comment on attachment 416274 [details] [diff] [review]
Proposed patch

r=christophe
Comment 2 Wan-Teh Chang 2009-12-07 16:53:01 PST
I checked in the patch on the NSPR trunk (NSPR 4.8.3).

Checking in runtests.pl;
/cvsroot/mozilla/nsprpub/pr/tests/runtests.pl,v  <--  runtests.pl
new revision: 1.7; previous revision: 1.6
done

Note You need to log in before you can comment on or make changes to this bug.