Skip to content

Commit

Permalink
Update CrateDB versions in test_reindex to work with newer JDKs
Browse files Browse the repository at this point in the history
  • Loading branch information
mfussenegger committed Sep 9, 2024
1 parent cdb7e25 commit f34562d
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions tests/test_reindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,36 +26,36 @@ def teardown(self):
shutil.rmtree(self.data_path, ignore_errors=True)

def test_reindex(self):
crate_v3 = CrateNode(
crate_dir=get_crate('3.x.x'),
crate_v4 = CrateNode(
crate_dir=get_crate('4.x.x'),
keep_data=True,
settings=self.crate_settings
)
self._to_stop.append(crate_v3)
crate_v3.start()
with client(crate_v3.http_url) as c:
self._to_stop.append(crate_v4)
crate_v4.start()
with client(crate_v4.http_url) as c:
aio.run(c.execute, "create table t (x int)")
args = (
(1,),
(2,),
(3,),
)
aio.run(c.execute_many, "insert into t (x) values (?)", args)
crate_v3.stop()
self._to_stop.remove(crate_v3)
crate_v4.stop()
self._to_stop.remove(crate_v4)

crate_v4 = CrateNode(
crate_dir=get_crate('4.0.3'),
crate_v5 = CrateNode(
crate_dir=get_crate('5.0.3'),
keep_data=True,
settings=self.crate_settings
)
self._to_stop.append(crate_v4)
crate_v4.start()
reindex(hosts=crate_v4.http_url)
with client(crate_v4.http_url) as c:
self._to_stop.append(crate_v5)
crate_v5.start()
reindex(hosts=crate_v5.http_url)
with client(crate_v5.http_url) as c:
result = aio.run(c.execute, "SELECT version FROM information_schema.tables WHERE table_name = 't'")
version = result['rows'][0][0]
self.assertEqual(version, {'upgraded': None, 'created': '4.0.3'})
self.assertEqual(version, {'upgraded': None, 'created': '5.0.3'})

cnt = aio.run(c.execute, 'SELECT count(*) FROM t')['rows'][0][0]
self.assertEqual(cnt, 3)

0 comments on commit f34562d

Please sign in to comment.