##// END OF EJS Templates
Shut down kernels in parallel...
Shut down kernels in parallel When stopping the notebook server, it currently sends a shutdown request to each kernel and then waits for the process to finish. This can be slow if you have several kernels running. This makes it issues all the shutdown requests before waiting on the processes, so shutdown happens in parallel. KernelManager (and MultiKernelManager) gain three new public API methods to allow this: * request_shutdown (promoted from a private method) * wait_shutdown (refactored out of shutdown_kernel) * cleanup (refactored out of shutdown_kernel)

File last commit:

r13552:8dbd39a1
r16510:633371e5
Show More
test_mongodb.py
56 lines | 1.5 KiB | text/x-python | PythonLexer
MinRK
update recently changed modules with Authors in docstring
r4018 """Tests for mongodb backend
Authors:
* Min RK
"""
MinRK
various db backend fixes...
r3875
#-------------------------------------------------------------------------------
# Copyright (C) 2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# Imports
#-------------------------------------------------------------------------------
Michał Górny
Respect DB_IP and DB_PORT in mongodb tests....
r9539 import os
MinRK
add size-limiting to the DictDB backend
r7533 from unittest import TestCase
MinRK
various db backend fixes...
r3875 from nose import SkipTest
from pymongo import Connection
from IPython.parallel.controller.mongodb import MongoDB
from . import test_db
Michał Górny
Respect DB_IP and DB_PORT in mongodb tests....
r9539 conn_kwargs = {}
if 'DB_IP' in os.environ:
conn_kwargs['host'] = os.environ['DB_IP']
Thomas Kluyver
Use username and password for MongoDB on ShiningPanda.
r13552 if 'DBA_MONGODB_ADMIN_URI' in os.environ:
# On ShiningPanda, we need a username and password to connect. They are
# passed in a mongodb:// URI.
conn_kwargs['host'] = os.environ['DBA_MONGODB_ADMIN_URI']
Michał Górny
Respect DB_IP and DB_PORT in mongodb tests....
r9539 if 'DB_PORT' in os.environ:
conn_kwargs['port'] = int(os.environ['DB_PORT'])
MinRK
various db backend fixes...
r3875 try:
Michał Górny
Respect DB_IP and DB_PORT in mongodb tests....
r9539 c = Connection(**conn_kwargs)
MinRK
various db backend fixes...
r3875 except Exception:
c=None
MinRK
add size-limiting to the DictDB backend
r7533 class TestMongoBackend(test_db.TaskDBTest, TestCase):
MinRK
various db backend fixes...
r3875 """MongoDB backend tests"""
def create_db(self):
try:
return MongoDB(database='iptestdb', _connection=c)
except Exception:
raise SkipTest("Couldn't connect to mongodb")
def teardown(self):
if c is not None:
c.drop_database('iptestdb')