fix get_name usage
This commit is contained in:
parent
32de7af33c
commit
88fde1af31
|
@ -89,20 +89,20 @@ class BaseThreadedTestCase(unittest.TestCase):
|
||||||
self._writerThread(*args, **kwargs)
|
self._writerThread(*args, **kwargs)
|
||||||
except db.DBLockDeadlockError:
|
except db.DBLockDeadlockError:
|
||||||
if verbose:
|
if verbose:
|
||||||
print(current_thread().get_name(), 'died from', e)
|
print(current_thread().name, 'died from', e)
|
||||||
else:
|
else:
|
||||||
if verbose:
|
if verbose:
|
||||||
print(current_thread().get_name(), "finished.")
|
print(current_thread().name, "finished.")
|
||||||
|
|
||||||
def readerThread(self, *args, **kwargs):
|
def readerThread(self, *args, **kwargs):
|
||||||
try:
|
try:
|
||||||
self._readerThread(*args, **kwargs)
|
self._readerThread(*args, **kwargs)
|
||||||
except db.DBLockDeadlockError as e:
|
except db.DBLockDeadlockError as e:
|
||||||
if verbose:
|
if verbose:
|
||||||
print(current_thread().get_name(), 'died from', e)
|
print(current_thread().name, 'died from', e)
|
||||||
else:
|
else:
|
||||||
if verbose:
|
if verbose:
|
||||||
print(current_thread().get_name(), "finished.")
|
print(current_thread().name, "finished.")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@ class ConcurrentDataStoreBase(BaseThreadedTestCase):
|
||||||
t.join()
|
t.join()
|
||||||
|
|
||||||
def _writerThread(self, d, howMany):
|
def _writerThread(self, d, howMany):
|
||||||
name = current_thread().get_name()
|
name = current_thread().name
|
||||||
start = 0
|
start = 0
|
||||||
stop = howMany
|
stop = howMany
|
||||||
if verbose:
|
if verbose:
|
||||||
|
@ -172,7 +172,7 @@ class ConcurrentDataStoreBase(BaseThreadedTestCase):
|
||||||
|
|
||||||
def _readerThread(self, d, readerNum):
|
def _readerThread(self, d, readerNum):
|
||||||
time.sleep(0.01 * readerNum)
|
time.sleep(0.01 * readerNum)
|
||||||
name = current_thread().get_name()
|
name = current_thread().name
|
||||||
|
|
||||||
for loop in range(5):
|
for loop in range(5):
|
||||||
c = d.cursor()
|
c = d.cursor()
|
||||||
|
@ -240,7 +240,7 @@ class SimpleThreadedBase(BaseThreadedTestCase):
|
||||||
t.join()
|
t.join()
|
||||||
|
|
||||||
def _writerThread(self, d, howMany, writerNum):
|
def _writerThread(self, d, howMany, writerNum):
|
||||||
name = current_thread().get_name()
|
name = current_thread().name
|
||||||
start = howMany * writerNum
|
start = howMany * writerNum
|
||||||
stop = howMany * (writerNum + 1) - 1
|
stop = howMany * (writerNum + 1) - 1
|
||||||
if verbose:
|
if verbose:
|
||||||
|
@ -286,7 +286,7 @@ class SimpleThreadedBase(BaseThreadedTestCase):
|
||||||
|
|
||||||
def _readerThread(self, d, readerNum):
|
def _readerThread(self, d, readerNum):
|
||||||
time.sleep(0.01 * readerNum)
|
time.sleep(0.01 * readerNum)
|
||||||
name = current_thread().get_name()
|
name = current_thread().name
|
||||||
|
|
||||||
for loop in range(5):
|
for loop in range(5):
|
||||||
c = d.cursor()
|
c = d.cursor()
|
||||||
|
@ -385,7 +385,7 @@ class ThreadedTransactionsBase(BaseThreadedTestCase):
|
||||||
time.sleep(0.05)
|
time.sleep(0.05)
|
||||||
|
|
||||||
def _writerThread(self, d, howMany, writerNum):
|
def _writerThread(self, d, howMany, writerNum):
|
||||||
name = current_thread().get_name()
|
name = current_thread().name
|
||||||
start = howMany * writerNum
|
start = howMany * writerNum
|
||||||
stop = howMany * (writerNum + 1) - 1
|
stop = howMany * (writerNum + 1) - 1
|
||||||
if verbose:
|
if verbose:
|
||||||
|
@ -427,7 +427,7 @@ class ThreadedTransactionsBase(BaseThreadedTestCase):
|
||||||
|
|
||||||
def _readerThread(self, d, readerNum):
|
def _readerThread(self, d, readerNum):
|
||||||
time.sleep(0.01 * readerNum + 0.05)
|
time.sleep(0.01 * readerNum + 0.05)
|
||||||
name = current_thread().get_name()
|
name = current_thread().name
|
||||||
|
|
||||||
for loop in range(5):
|
for loop in range(5):
|
||||||
finished = False
|
finished = False
|
||||||
|
|
Loading…
Reference in New Issue