Repository: incubator-impala
Updated Branches:
  refs/heads/master e3075c39a -> db60c1cd2


IMPALA-5820: Fix string format() syntax in test_scanners_fuzz.py

Make the call to format() compatible with older versions of python
(< 2.7), which expect an indices in the string being formatted,
e.g. "{0} {1} {2}".format('foo', 'bar', 'baz'). Without the numbers,
format() raises an exception.

Tested by running this test suite using python 2.6.6. Before the
patch, the tests failed. After the patch, they pass.

Change-Id: I5384aaf83a6a1f3c7643ed9f15de2dba1a5913a5
Reviewed-on: http://gerrit.cloudera.org:8080/7761
Reviewed-by: David Knupp <[email protected]>
Tested-by: Impala Public Jenkins


Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/db60c1cd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/db60c1cd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/db60c1cd

Branch: refs/heads/master
Commit: db60c1cd24ea80bded09dd93a2f28f548ce9db32
Parents: e3075c3
Author: David Knupp <[email protected]>
Authored: Mon Aug 21 14:05:12 2017 -0700
Committer: Impala Public Jenkins <[email protected]>
Committed: Tue Aug 22 20:41:07 2017 +0000

----------------------------------------------------------------------
 tests/query_test/test_scanners_fuzz.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/db60c1cd/tests/query_test/test_scanners_fuzz.py
----------------------------------------------------------------------
diff --git a/tests/query_test/test_scanners_fuzz.py 
b/tests/query_test/test_scanners_fuzz.py
index 41c8d6b..53fe348 100644
--- a/tests/query_test/test_scanners_fuzz.py
+++ b/tests/query_test/test_scanners_fuzz.py
@@ -218,13 +218,13 @@ class TestScannersFuzzing(ImpalaTestSuite):
     for _ in xrange(num_corruptions):
       flip_offset = rng.randint(0, len(data) - 1)
       flip_val = rng.randint(0, 255)
-      LOG.info("corrupt file: Flip byte in {} at {} from {} to {}".format(
+      LOG.info("corrupt file: Flip byte in {0} at {1} from {2} to {3}".format(
           path, flip_offset, data[flip_offset], flip_val))
       data[flip_offset] = flip_val
 
     if rng.random() < 0.4:
       truncation = rng.randint(0, len(data))
-      LOG.info("corrupt file: Truncate {} to {}".format(path, truncation))
+      LOG.info("corrupt file: Truncate {0} to {1}".format(path, truncation))
       data = data[:truncation]
 
     with open(path, "wb") as f:

Reply via email to