Changeset 86922 in webkit
- Timestamp:
- May 19, 2011 9:10:49 PM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r86907 r86922 1 2011-05-19 Dmitry Lomov <dslomov@google.com> 2 3 Reviewed by Adam Roben. 4 5 Detect hangs in run-api-tests 6 https://bugs.webkit.org/show_bug.cgi?id=48043 7 8 * Scripts/run-api-tests: Added test timeouts 9 1 10 2011-05-19 Dmitry Lomov <dslomov@google.com> 2 11 -
trunk/Tools/Scripts/run-api-tests
r86907 r86922 46 46 sub runTest($$); 47 47 48 # Timeout for individual test, in sec 49 my $timeout = 10; 50 48 51 my $showHelp = 0; 49 52 my $verbose = 0; … … 132 135 133 136 my $result = 0; 137 my $timedOut = 0; 134 138 if (isAppleMacWebKit()) { 135 139 my $productDir = productDir(); … … 160 164 close($childErr); 161 165 close(DEVNULL) unless ($verbose); 162 163 waitpid($pid, 0); 164 $result = $?; 165 } elsif (isAppleWinWebKit()) { 166 eval { 167 local $SIG{ALRM} = sub { die "alarm\n" }; 168 alarm $timeout; 169 waitpid($pid, 0); 170 alarm 0; 171 $result = $?; 172 }; 173 if ($@) { 174 die unless $@ eq "alarm\n"; 175 kill SIGTERM, $pid or kill SIGKILL, $pid; 176 $timedOut = 1; 177 }; 178 179 } elsif (isAppleWinWebKit()) { 166 180 my $apiTesterNameSuffix; 167 181 if (configurationForVisualStudio() ne "Debug_All") { … … 171 185 } 172 186 my $apiTesterPath = File::Spec->catfile(productDir(), "TestWebKitAPI$apiTesterNameSuffix.exe"); 173 $result = system { $apiTesterPath } $apiTesterPath, $gtestArg, @ARGV; 187 eval { 188 local $SIG{ALRM} = sub { die "alarm\n" }; 189 alarm $timeout; 190 $result = system { $apiTesterPath } $apiTesterPath, $gtestArg, @ARGV; 191 alarm 0; 192 }; 193 if ($@) { 194 die unless $@ eq "alarm\n"; 195 $timedOut = 1; 196 }; 174 197 } else { 175 198 die "run-api-tests is not supported on this platform.\n" 176 199 } 177 178 if (!$result) { 200 201 if ($timedOut) { 202 print BOLD YELLOW, "Timeout", RESET, "\n"; 203 } elsif (!$result) { 179 204 print BOLD GREEN, "Passed", RESET, "\n"; 180 205 } else { 181 206 print BOLD RED, "Failed", RESET, "\n"; 182 207 } 183 return $ result;208 return $timedOut || $result; 184 209 } 185 210
Note: See TracChangeset
for help on using the changeset viewer.