Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

SERVER-5175 modified tests to better print errors

  • Loading branch information...
commit 966a5473ad1eb7d847da5e2f8c81e0e2e1b3ce9d 1 parent efbca4c
Randolph Tan renctan authored
Showing with 21 additions and 3 deletions.
  1. +21 −3 src/mongo/util/fail_point_test.cpp
24 src/mongo/util/fail_point_test.cpp
View
@@ -171,7 +171,14 @@ namespace mongo_test {
while (true) {
MONGO_FAIL_POINT_BLOCK((*failPoint)) {
const mongo::BSONObj& data = failPoint->getData();
- ASSERT_EQUALS(44, data["a"].numberInt());
+
+ // Expanded ASSERT_EQUALS since the error is not being
+ // printed out properly
+ if (data["a"].numberInt() != 44) {
+ mongo::error() << "blockTask thread detected anomaly"
+ << " - data: " << data << std::endl;
+ ASSERT(false);
+ }
}
boost::this_thread::interruption_point();
@@ -183,7 +190,13 @@ namespace mongo_test {
try {
MONGO_FAIL_POINT_BLOCK((*failPoint)) {
const mongo::BSONObj& data = failPoint->getData();
- ASSERT_EQUALS(44, data["a"].numberInt());
+
+ if (data["a"].numberInt() != 44) {
+ mongo::error() << "blockWithExceptionTask thread detected anomaly"
+ << " - data: " << data << std::endl;
+ ASSERT(false);
+ }
+
throw std::logic_error("blockWithExceptionTask threw");
}
}
@@ -198,7 +211,12 @@ namespace mongo_test {
while (true) {
if (MONGO_FAIL_POINT((*failPoint))) {
const mongo::BSONObj& data = failPoint->getData();
- ASSERT_EQUALS(44, data["a"].numberInt());
+
+ if (data["a"].numberInt() != 44) {
+ mongo::error() << "simpleTask thread detected anomaly - "
+ << " data: " << data << std::endl;
+ ASSERT(false);
+ }
}
boost::this_thread::interruption_point();
Please sign in to comment.
Something went wrong with that request. Please try again.