Skip to content

Commit

Permalink
Clean up database branching test cases
Browse files Browse the repository at this point in the history
We don't need to query or set __internal_testmode in order to create a
database from a template anymore. Clean up that code.

This will also fix a flake, probably, but we *are* planning to fix it
more properly (see #6349).
  • Loading branch information
msullivan committed Mar 1, 2024
1 parent 37cfbe7 commit 56324af
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions edb/testbase/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -1073,20 +1073,6 @@ async def setup_and_connect(cls):
elif cls.uses_database_copies():
admin_conn = await cls.connect()

orig_testmode = await admin_conn.query(
'SELECT cfg::Config.__internal_testmode',
)
if not orig_testmode:
orig_testmode = False
else:
orig_testmode = orig_testmode[0]

# Enable testmode to unblock the template database syntax below.
if not orig_testmode:
await admin_conn.execute(
'CONFIGURE SESSION SET __internal_testmode := true;',
)

base_db_name, _, _ = dbname.rpartition('_')

if cls.get_setup_script():
Expand All @@ -1108,11 +1094,6 @@ async def setup_and_connect(cls):
async with tr:
await admin_conn.execute(create_command)

if not orig_testmode:
await admin_conn.execute(
'CONFIGURE SESSION SET __internal_testmode := false;',
)

await admin_conn.aclose()

cls.con = await cls.connect(database=dbname)
Expand Down

0 comments on commit 56324af

Please sign in to comment.