Skip to content

Commit

Permalink
Fix CI test failure by cleaning up in test_edgeql_ddl_reindex (#6955)
Browse files Browse the repository at this point in the history
Also fix a loss of ordering in the tests caused by the `get_setup_script` change and its interaction with `get_cases_by_shard`.
  • Loading branch information
msullivan committed Mar 7, 2024
1 parent c4f95b4 commit 98fad1d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 23 deletions.
4 changes: 2 additions & 2 deletions edb/testbase/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -2456,8 +2456,8 @@ def get_cases_by_shard(cases, selected_shard, total_shards, verbosity, stats):
# Prepare the source heaps
setup_count = 0
for case, tests in cases.items():
setup_script = getattr(case, 'get_setup_script', lambda: None)()
if setup_script and tests:
setup_script_getter = getattr(case, 'get_setup_script', None)
if setup_script_getter and tests:
tests_per_setup = []
est_per_setup = setup_est = stats.get(
'setup::' + case.get_database_name(), (new_setup_est, 0),
Expand Down
50 changes: 29 additions & 21 deletions tests/test_edgeql_ddl.py
Original file line number Diff line number Diff line change
Expand Up @@ -16199,27 +16199,35 @@ async def test_edgeql_ddl_reindex(self):
create module test;
create type test::Bar extending Foo;
''')
await self.con.execute('''
administer reindex(Foo)
''')
await self.con.execute('''
administer reindex(Foo.foo)
''')
await self.con.execute('''
administer reindex(Foo.bar)
''')
await self.con.execute('''
administer reindex(Foo.tgt)
''')
await self.con.execute('''
administer reindex(Foo.tgts)
''')
await self.con.execute('''
administer reindex(test::Bar)
''')
await self.con.execute('''
administer reindex(Object)
''')
try:
await self.con.execute('''
administer reindex(Foo)
''')
await self.con.execute('''
administer reindex(Foo.foo)
''')
await self.con.execute('''
administer reindex(Foo.bar)
''')
await self.con.execute('''
administer reindex(Foo.tgt)
''')
await self.con.execute('''
administer reindex(Foo.tgts)
''')
await self.con.execute('''
administer reindex(test::Bar)
''')
await self.con.execute('''
administer reindex(Object)
''')
finally:
await self.con.execute('''
drop type test::Bar;
drop type Foo;
drop type Tgt;
drop module test;
''')

async def _deadlock_tester(self, setup, teardown, modification, query):
"""Deadlock test helper.
Expand Down

0 comments on commit 98fad1d

Please sign in to comment.