Beispiel #1
0
    def tearDown( self ):
        # Dump threads and look for deadlocks (independent of success)
        deadlockLogs = self.framework.checkForDeadlock()
        if deadlockLogs:
            log.error( 'Deadlocks detected!' )
            self.fail( 'Failing due to deadlock detection.  Check the following log file(s): ' + ', '.join( deadlockLogs ) )
        else:
            log.info( 'No deadlocks detected' )

        if self.delayShutdown:
            raw_input( '>>> Delaying shutdown.  Press Enter to continue...' )

        log.info( 'Stopping framework' )
        self.framework.stop()
        self.failIf( self.framework.isRunning, 'Framework did not stop' )

        unittest.TestCase.tearDown( self )
Beispiel #2
0
    def tearDown(self):
        # Dump threads and look for deadlocks (independent of success)
        deadlockLogs = self.framework.checkForDeadlock()
        if deadlockLogs:
            log.error("Deadlocks detected!")
            self.fail("Failing due to deadlock detection.  Check the following log file(s): " + ", ".join(deadlockLogs))
        else:
            log.info("No deadlocks detected")

        if self.delayShutdown:
            raw_input(">>> Delaying shutdown.  Press Enter to continue...")

        log.info("Stopping framework")
        self.framework.stop()
        self.failIf(self.framework.isRunning, "Framework did not stop")

        unittest.TestCase.tearDown(self)
Beispiel #3
0
                                randomV3Tests ) )

# Release-candidate tests
postTagTests = unittest.TestSuite( ( tinyUiTests, v3Tests ) )


# Module globals
frameworkList = []
deleteAfterSuccess = lockss_util.config.getBoolean( 'deleteAfterSuccess', True )

if __name__ == '__main__':
    try:
        unittest.main( defaultTest = 'v3Tests',
                       argv = sys.argv[ 0 : 1 ] + [ '-q' ] + sys.argv[ 1 : ] )
    except ( KeyboardInterrupt, SystemExit ), exception:
        for framework in frameworkList:
            if framework.isRunning:
                log.info( 'Stopping framework' )
                framework.stop()

        if type( exception ) is KeyboardInterrupt:
            sys.exit(2)
        if type( exception ) is SystemExit:
            if not exception.code and deleteAfterSuccess:
                for framework in frameworkList:
                    framework.clean()
            raise
    except Exception, exception:
        log.error( exception )
        raise