Skip to content

Commit d1788e5

Browse files
committed
upd migrate test
1 parent cfa4d11 commit d1788e5

File tree

2 files changed

+32
-4
lines changed

2 files changed

+32
-4
lines changed

itest/lib/node.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,15 @@ async def init(self):
9595
await self.expect(
9696
'Well done, you successfully initialized ThingsDB!!', timeout=5)
9797

98-
async def wait_join(self, secret: str):
98+
async def wait_join(self, secret: str, timeout: int = 5):
9999
self.start(secret=secret)
100100
await self.expect(
101-
'start listening for node connections', timeout=5)
101+
'start listening for node connections', timeout=timeout)
102102

103-
async def run(self):
103+
async def run(self, timeout: int = 5):
104104
self.start()
105105
await self.expect(
106-
'start listening for node connections', timeout=5)
106+
'start listening for node connections', timeout=timeout)
107107

108108
async def init_and_run(self):
109109
await self.init()

itest/test_migrate.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python
22
import asyncio
33
import os
4+
import logging
45
from lib import run_test
56
from lib import default_test_setup
67
from lib.testbase import TestBase
@@ -28,6 +29,14 @@ async def run(self):
2829
if not fn.endswith('.tar.gz'):
2930
continue
3031

32+
logging.warning(f"""
33+
{'#' * 80}
34+
35+
Next file: {fn}
36+
37+
{'#' * 80}
38+
""")
39+
3140
fn = os.path.join(BACKUP_PATH, fn)
3241

3342
collections = await query('collections_info();')
@@ -40,6 +49,25 @@ async def run(self):
4049
await asyncio.sleep(10)
4150
await client.authenticate('admin', 'pass')
4251

52+
logging.warning(f"""
53+
{'#' * 80}
54+
55+
Imported file: {fn}, restart test...
56+
57+
{'#' * 80}
58+
""")
59+
60+
await self.node0.shutdown()
61+
await self.node0.run(timeout=20)
62+
63+
logging.warning(f"""
64+
{'#' * 80}
65+
66+
Finished file: {fn}
67+
68+
{'#' * 80}
69+
""")
70+
4371
client.close()
4472
await client.wait_closed()
4573

0 commit comments

Comments
 (0)