Repository: incubator-hawq
Updated Branches:
  refs/heads/master c89b3e2ca -> 3fae12336


HAWQ-1400. Add a small sleeping period in feature test utility before dropping 
test database


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

Branch: refs/heads/master
Commit: 3fae12336c7af816a9efbeb02830725f12bc6f7a
Parents: c89b3e2
Author: Yi <y...@pivotal.io>
Authored: Thu Mar 23 13:44:08 2017 +1100
Committer: Yi <y...@pivotal.io>
Committed: Thu Mar 23 13:44:08 2017 +1100

----------------------------------------------------------------------
 src/test/feature/lib/sql_util.cpp | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/3fae1233/src/test/feature/lib/sql_util.cpp
----------------------------------------------------------------------
diff --git a/src/test/feature/lib/sql_util.cpp 
b/src/test/feature/lib/sql_util.cpp
index 9bb3613..07071f4 100644
--- a/src/test/feature/lib/sql_util.cpp
+++ b/src/test/feature/lib/sql_util.cpp
@@ -71,6 +71,20 @@ SQLUtility::SQLUtility(SQLUtilityMode mode)
 
 SQLUtility::~SQLUtility() {
   if (!test_info->result()->Failed()) {
+
+       
//--------------------------------------------------------------------------
+       // This is a temporary work around to sleep a short time window in 
order to
+       // wait for the quit of query dispatcher processes. Because each query
+       // dispatcher has one resource heart-beat thread to be joined before the
+       // exit, in worst case, that thread will sleep 100ms and consequently 
check
+       // the switch variable to complete the exiting logic. This may causes 
the
+       // error reporting that the database is still accessed by other users, 
when
+       // user drops database once finished using database.
+       //
+       // When we have that exit logic improved, we can remove this logic.
+       
//--------------------------------------------------------------------------
+
+    usleep(200000);
     if (schemaName != HAWQ_DEFAULT_SCHEMA) {
       exec("DROP SCHEMA " + schemaName + " CASCADE");
     }

Reply via email to