IMPALA-6983: stress: don't write a null runtime profile

This patch fixes a problem in which the writing of profiles always
assumed profiles would be collected during binary. That's not the case
when queries are too expensive to run. The simple fix is to just check
for None and not perform the write.

Change-Id: Ic8299a8a97ad1f2bd1f2927e3111db8df1d3a3e5
Reviewed-on: http://gerrit.cloudera.org:8080/10381
Reviewed-by: Michael Brown <mi...@cloudera.com>
Tested-by: Michael Brown <mi...@cloudera.com>


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

Branch: refs/heads/2.x
Commit: 6daf9800c07e6d291409dcf1abf06f3f97b85e9e
Parents: 14c715c
Author: Michael Brown <mi...@cloudera.com>
Authored: Fri May 11 11:38:56 2018 -0700
Committer: Impala Public Jenkins <impala-public-jenk...@gerrit.cloudera.org>
Committed: Thu May 17 22:03:02 2018 +0000

----------------------------------------------------------------------
 tests/stress/concurrent_select.py | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/impala/blob/6daf9800/tests/stress/concurrent_select.py
----------------------------------------------------------------------
diff --git a/tests/stress/concurrent_select.py 
b/tests/stress/concurrent_select.py
index 4316672..1e31fa4 100755
--- a/tests/stress/concurrent_select.py
+++ b/tests/stress/concurrent_select.py
@@ -960,6 +960,9 @@ class Query(object):
          self.solo_runtime_profile_without_spilling),
     ]
     for filename, profile in profiles_to_write:
+      if profile is None:
+        LOG.debug("No profile recorded for {0}".format(filename))
+        continue
       with open(os.path.join(directory, filename), "w") as fh:
         fh.write(profile)
 

Reply via email to