Skip to content

Commit

Permalink
one connect per process
Browse files Browse the repository at this point in the history
  • Loading branch information
gpfrancis committed Aug 19, 2024
1 parent 002c2cb commit eecd15a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/integration/common/src/test_manage_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
nid = 7

def func(msl, iproc):
msl = mysql.connector.connect(**config)
ms = manage_status(msl, 'test_lasair_statistics')
for i in range(niter):
time.sleep(deltaT*random())
Expand Down Expand Up @@ -70,7 +71,7 @@ def test_delete(self):
self.assertEqual(status, {})

def test_multiprocessing(self):
msl = mysql.connector.connect(**config)
msl = None
procs = []
for iproc in range(nproc):
proc = Process(target=func, args=(msl, iproc,))
Expand All @@ -79,6 +80,7 @@ def test_multiprocessing(self):
for proc in procs:
proc.join()

msl = mysql.connector.connect(**config)
ms = manage_status(msl, 'test_lasair_statistics')
status = ms.read(nid)
# print(status)
Expand Down

0 comments on commit eecd15a

Please sign in to comment.