You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ha...@apache.org on 2014/06/24 07:40:33 UTC

svn commit: r1605006 - /hive/trunk/hcatalog/src/test/e2e/templeton/drivers/TestDriverCurl.pm

Author: hashutosh
Date: Tue Jun 24 05:40:33 2014
New Revision: 1605006

URL: http://svn.apache.org/r1605006
Log:
HIVE-6564 : WebHCat E2E tests that launch MR jobs fail on check job completion timeout (Deepesh Khandelwal via Ashutosh Chauhan)

Modified:
    hive/trunk/hcatalog/src/test/e2e/templeton/drivers/TestDriverCurl.pm

Modified: hive/trunk/hcatalog/src/test/e2e/templeton/drivers/TestDriverCurl.pm
URL: http://svn.apache.org/viewvc/hive/trunk/hcatalog/src/test/e2e/templeton/drivers/TestDriverCurl.pm?rev=1605006&r1=1605005&r2=1605006&view=diff
==============================================================================
--- hive/trunk/hcatalog/src/test/e2e/templeton/drivers/TestDriverCurl.pm (original)
+++ hive/trunk/hcatalog/src/test/e2e/templeton/drivers/TestDriverCurl.pm Tue Jun 24 05:40:33 2014
@@ -677,6 +677,9 @@ sub compare
           @sorted_filtered_body = sort { $a cmp $b } @filtered_body;
         }
         my $value = $path->value(\@sorted_filtered_body);
+        if (JSON::is_bool($value)) {
+          $value = $value ? 'true' : 'false';
+        }
         
         if ($value !~ /$regex_expected_value/s) {
           print $log "$0::$subName INFO check failed:"
@@ -720,6 +723,9 @@ sub compare
           #flatten the object into a string
           $json_field_val = dump($json_field_val);
         }
+        if (JSON::is_bool($json_field_val)) {
+          $json_field_val = $json_field_val ? 'true' : 'false';
+        }
         my $regex_expected_value = $json_matches->{$key};
         print $log "Comparing $key: $json_field_val with regex /$regex_expected_value/\n";
 
@@ -830,7 +836,7 @@ sub compare
           #first wait for job completion
           while ($NUM_RETRIES-- > 0) {
             $jobComplete = $res_hash->{'status'}->{'jobComplete'};
-            if (defined $jobComplete && lc($jobComplete) eq "true") {
+            if (defined $jobComplete && (lc($jobComplete) eq "true" || lc($jobComplete) eq "1")) {
               last;
             }
             sleep $SLEEP_BETWEEN_RETRIES;
@@ -838,7 +844,7 @@ sub compare
             $json = new JSON;
             $res_hash = $json->utf8->decode($jobResult->{'body'});
           }
-          if ( (!defined $jobComplete) || lc($jobComplete) ne "true") {
+          if ( (!defined $jobComplete) || (lc($jobComplete) ne "true" && lc($jobComplete) ne "1")) {
             print $log "$0::$subName WARN check failed: " 
               . " timeout on wait for job completion ";
             $result = 0;