fix(qa): isolate legacy database clients with owned transport guard

This commit is contained in:
wangzhibiao committed 2026-10-15 02:54:00 +08:00
1 parent 65c567152e
commit 01e949093a
9 files changed
+577 -23

No files matched your search

+3 -1
View File
@@ -63,13 +63,15 @@ class QaToolsTest(unittest.TestCase):
self.assertEqual('$(touch should-not-exist)', qa.load_config(path)['KEY'])
def test_migration_preflight_prevents_all_processes(self):
with patch.object(qa, 'inspect', return_value=2), patch.object(qa, 'launch') as launch:
with patch.object(qa.qa_isolation, 'require', return_value={'isolation_id':'synthetic'}), \
patch.object(qa, 'inspect', return_value=2), patch.object(qa, 'launch') as launch:
with self.assertRaises(ValueError):
qa.start({}, {}, 18096, 16389)
launch.assert_not_called()
def test_start_flags_and_secret_handling(self):
with tempfile.TemporaryDirectory() as directory, patch.object(qa, 'RUNTIME', Path(directory)), \
patch.object(qa.qa_isolation, 'require', return_value={'isolation_id':'synthetic'}), \
patch.object(qa, 'inspect', return_value=0), patch.object(qa, 'available'), patch.object(qa, 'launch') as launch:
config = {'FUSION_QA_APP_PASSWORD':'synthetic', 'TRAIN_STUDENT_IDENTITY_ENCRYPTION_KEY':'synthetic', 'TRAIN_STUDENT_IDENTITY_HASH_KEY':'synthetic'}
qa.start(config, qa.environment(config), 18096, 16389)