BIND 10 trac2212-2, updated. cf72f036909c786091f845a736bfd6fcfd15a7ac [2212] guard death tests with !runningOnValgrind().

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Oct 26 16:20:13 UTC 2012


The branch, trac2212-2 has been updated
       via  cf72f036909c786091f845a736bfd6fcfd15a7ac (commit)
       via  e4850b8e75f2d8fd4924b5060cbf3c4458d3513d (commit)
       via  aade8ac800d58c46dad9ab862cf0d6e85174b17d (commit)
      from  d8b60408e4843a88d15e3cd95dfeb898cea2a8fd (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit cf72f036909c786091f845a736bfd6fcfd15a7ac
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Fri Oct 26 09:19:41 2012 -0700

    [2212] guard death tests with !runningOnValgrind().

commit e4850b8e75f2d8fd4924b5060cbf3c4458d3513d
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Fri Oct 26 09:14:10 2012 -0700

    [2212] wording updates to BUILDER_COMMAND_ERROR description

commit aade8ac800d58c46dad9ab862cf0d6e85174b17d
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Fri Oct 26 09:12:29 2012 -0700

    [2212-2] added an unnecessary return to silence some compilers

-----------------------------------------------------------------------

Summary of changes:
 src/bin/auth/auth_messages.mes                     |   14 +++---
 src/bin/auth/datasrc_clients_mgr.h                 |    4 ++
 .../auth/tests/datasrc_clients_builder_unittest.cc |   49 ++++++++++++--------
 3 files changed, 40 insertions(+), 27 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/bin/auth/auth_messages.mes b/src/bin/auth/auth_messages.mes
index 7eab98a..163b6ba 100644
--- a/src/bin/auth/auth_messages.mes
+++ b/src/bin/auth/auth_messages.mes
@@ -62,13 +62,13 @@ A debug message, showing when the separate thread for maintaining data
 source clients receives a command from the manager.
 
 % AUTH_DATASRC_CLIENTS_BUILDER_COMMAND_ERROR command execution failure: %1
-The separate thread for maintaining data source clients failed to complete
-a comment given by the main thread.  In most cases this is some kind of
-configuration or temporary errors such as an attempt of non existent zone
-or temporary DB connection failure.  So the event is just logged and the
-thread keeps running.  In some rare cases, however, this may indicate
-an internal bug and it may be better to restart the entire program.
-So the log message should be carefully examined.
+The separate thread for maintaining data source clients failed to complete a
+command given by the main thread.  In most cases this is some kind of
+configuration or temporary error such as an attempt to load a non-existent
+zone or a temporary DB connection failure.  So the event is just logged and
+the thread keeps running.  In some rare cases, however, this may indicate an
+internal bug and it may be better to restart the entire program, so the log
+message should be carefully examined.
 
 % AUTH_DATASRC_CLIENTS_BUILDER_FAILED data source builder thread stopped due to an exception: %1
 The separate thread for maintaining data source clients has been
diff --git a/src/bin/auth/datasrc_clients_mgr.h b/src/bin/auth/datasrc_clients_mgr.h
index 0628657..aaaf896 100644
--- a/src/bin/auth/datasrc_clients_mgr.h
+++ b/src/bin/auth/datasrc_clients_mgr.h
@@ -561,6 +561,10 @@ DataSrcClientsBuilderBase<MutexType, CondVarType>::getZoneWriter(
                   << "/" << rrclass << ": internal failure, in-memory cache "
                   "is somehow disabled");
     }
+
+    // all cases above should either return or throw, but some compilers
+    // still need a return statement
+    return (boost::shared_ptr<datasrc::memory::ZoneWriter>());
 }
 } // namespace datasrc_clientmgr_internal
 
diff --git a/src/bin/auth/tests/datasrc_clients_builder_unittest.cc b/src/bin/auth/tests/datasrc_clients_builder_unittest.cc
index 5ae1b7a..0712ef7 100644
--- a/src/bin/auth/tests/datasrc_clients_builder_unittest.cc
+++ b/src/bin/auth/tests/datasrc_clients_builder_unittest.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#include <util/unittests/check_valgrind.h>
+
 #include <dns/name.h>
 #include <dns/rrclass.h>
 
@@ -98,13 +100,15 @@ TEST_F(DataSrcClientsBuilderTest, exception) {
     // them.  Right now, we simply abort to prevent the system from running
     // with half-broken state.  Eventually we should introduce a better
     // error handling.
-    command_queue.push_back(noop_cmd);
-    queue_mutex.throw_from_noop = TestMutex::EXCLASS;
-    EXPECT_DEATH_IF_SUPPORTED({builder.run();}, "");
+    if (!isc::util::unittests::runningOnValgrind()) {
+        command_queue.push_back(noop_cmd);
+        queue_mutex.throw_from_noop = TestMutex::EXCLASS;
+        EXPECT_DEATH_IF_SUPPORTED({builder.run();}, "");
 
-    command_queue.push_back(noop_cmd);
-    queue_mutex.throw_from_noop = TestMutex::INTEGER;
-    EXPECT_DEATH_IF_SUPPORTED({builder.run();}, "");
+        command_queue.push_back(noop_cmd);
+        queue_mutex.throw_from_noop = TestMutex::INTEGER;
+        EXPECT_DEATH_IF_SUPPORTED({builder.run();}, "");
+    }
 
     command_queue.push_back(noop_cmd);
     command_queue.push_back(shutdown_cmd); // we need to stop the loop
@@ -457,10 +461,12 @@ TEST_F(DataSrcClientsBuilderTest, loadZoneWithoutDataSrc) {
 TEST_F(DataSrcClientsBuilderTest, loadZoneInvalidParams) {
     configureZones();
 
-    // null arg: this causes assertion failure
-    EXPECT_DEATH_IF_SUPPORTED({
-            builder.handleCommand(Command(LOADZONE, ElementPtr()));
-        }, "");
+    if (!isc::util::unittests::runningOnValgrind()) {
+        // null arg: this causes assertion failure
+        EXPECT_DEATH_IF_SUPPORTED({
+                builder.handleCommand(Command(LOADZONE, ElementPtr()));
+            }, "");
+    }
 
     // zone class is bogus (note that this shouldn't happen except in tests)
     EXPECT_THROW(builder.handleCommand(
@@ -479,16 +485,19 @@ TEST_F(DataSrcClientsBuilderTest, loadZoneInvalidParams) {
                  isc::data::TypeError);
 
     // class or origin is missing: result in assertion failure
-    EXPECT_DEATH_IF_SUPPORTED({
-            builder.handleCommand(
-                Command(LOADZONE,
-                        Element::fromJSON("{\"origin\": \"test1.example\"}")));
-        }, "");
-    EXPECT_DEATH_IF_SUPPORTED({
-            builder.handleCommand(Command(LOADZONE,
-                                          Element::fromJSON(
-                                              "{\"class\": \"IN\"}")));
-        }, "");
+    if (!isc::util::unittests::runningOnValgrind()) {
+        EXPECT_DEATH_IF_SUPPORTED({
+                builder.handleCommand(
+                    Command(LOADZONE,
+                            Element::fromJSON(
+                                "{\"origin\": \"test1.example\"}")));
+            }, "");
+        EXPECT_DEATH_IF_SUPPORTED({
+                builder.handleCommand(Command(LOADZONE,
+                                              Element::fromJSON(
+                                                  "{\"class\": \"IN\"}")));
+            }, "");
+    }
 
     // zone doesn't exist in the data source
     EXPECT_THROW(



More information about the bind10-changes mailing list