Uploaded image for project: 'Rya'
  1. Rya
  2. RYA-363

Unit tests fail with no information when mongoDB fails to start

Add voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.2.11
    • 3.2.12
    • None

    Description

      When MockMongoFactory fails for whatever reason, the logs do not show an error unless log4J is configured and INFO is logged. This is not the case for a standard "mvn clean install" so all you see is this:

      > java.lang.NullPointerException: null
      > at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:191)
      > at org.apache.rya.mongodb.MongoDBRdfConfiguration.setMongoClient( MongoDBRdfConfiguration.java:267) ...

      Change it so that it always shows an error that contains some indication of the root cause – even if it says that mongodb failed to initialize, better would be to show the mongdb output, like below.
      This should be in the [ERROR] log, not the [INFO]

      2017-08-31 14:24:48,466 INFO  [Thread-3] mongodb.MockMongoFactory (Slf4jLevel.java:log(42)) -
      [initandlisten] terminate() called. An exception is active; attempting to gather more information[mongod output]
      [initandlisten] std::exception::what(): Resource temporarily unavailable[mongod output]
      Actual exception type: std::system_error[mongod output] 
      
      

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            isper3at Andrew Smith
            dlotts David Lotts

            Dates

              Created:
              Updated:

              Slack

                Issue deployment