diff --git a/iosApp/HoneyDueUITests/Framework/AuthenticatedUITestCase.swift b/iosApp/HoneyDueUITests/Framework/AuthenticatedUITestCase.swift index d14f84a..44c730a 100644 --- a/iosApp/HoneyDueUITests/Framework/AuthenticatedUITestCase.swift +++ b/iosApp/HoneyDueUITests/Framework/AuthenticatedUITestCase.swift @@ -17,6 +17,12 @@ class AuthenticatedUITestCase: BaseUITestCase { /// (sets OnboardingState.hasCompletedOnboarding) so login lands on main tabs. override var completeOnboarding: Bool { true } + /// Per-test isolation relaunches the app fresh for every test. With + /// --reset-state this lands on the login screen, so each test logs in as its + /// own fresh account WITHOUT a fragile UI logout between tests (the old + /// logout-via-profile path was the #1 source of flakes under load). + override var relaunchBetweenTests: Bool { true } + /// Credentials for the Kratos APP identity used to seed data over the API. /// /// ⚠️ TWO DIFFERENT "admin@honeydue.com" EXIST — do NOT "fix" Test1234 to password123: @@ -116,11 +122,10 @@ class AuthenticatedUITestCase: BaseUITestCase { try super.setUpWithError() if usesFreshAccount { - // Per-test isolation: every test logs in as its OWN fresh, pre-verified - // account, seeds under its token, and deletes it in teardown. The app - // may be reused from a previous test (still logged in as that test's - // account), so always log out first. - UITestHelpers.ensureLoggedOut(app: app) + // Per-test isolation: relaunchBetweenTests gives every test a fresh + // app launch that lands on the login screen (--reset-state), so we + // log in as a brand-new pre-verified account, seed under its token, + // and delete it in teardown. No UI logout between tests. let acct = TestAccount.create(domain: accountDomain) account = acct session = acct.session diff --git a/iosApp/run_ui_tests.sh b/iosApp/run_ui_tests.sh index bc83416..34496b5 100755 --- a/iosApp/run_ui_tests.sh +++ b/iosApp/run_ui_tests.sh @@ -34,7 +34,10 @@ SCHEME="HoneyDueUITests" API_SCHEME="HoneyDueAPITests" TARGET="HoneyDueUITests" DESTINATION="platform=iOS Simulator,name=iPhone 17 Pro" -WORKERS=8 +# Data isolation removed cross-suite races, but each test now relaunches the +# app + creates an account, so the bottleneck is CPU/simulator. 4 is the reliable +# sweet spot on a Mac mini (8 thrashed the simulators -> UI timeouts). Override via arg 2. +WORKERS=4 # Suites that run in their own phases — excluded from the parallel phase. PHASE_MANAGED=(