Skip to content

Instantly share code, notes, and snippets.

@cdeil
Created August 14, 2026 09:17
Show Gist options
  • Select an option

  • Save cdeil/86fa41676fbfa99aee87c6f4c42d5e80 to your computer and use it in GitHub Desktop.

Select an option

Save cdeil/86fa41676fbfa99aee87c6f4c42d5e80 to your computer and use it in GitHub Desktop.
Minimal Patrol/Xcode post-test diagnostics reproducer
import 'package:patrol/patrol.dart';
void main() {
for (var index = 1; index <= 61; index++) {
patrolTest('long suite test $index', ($) async {
await Future<void>.delayed(const Duration(seconds: 10));
});
}
}

Patrol / Xcode post-test diagnostics reproducer

This uses Patrol's own example app and contains no application-specific code.

Environment verified:

  • Patrol master ede803499
  • Patrol CLI master ede803499
  • Flutter 3.47.0 / Dart 3.13.0
  • Xcode 26.6 on macOS 26.6.1
  • iPad (A16) simulator on iOS 26.5

Copy diagnostic_collection_repro_test.dart into packages/patrol/example/patrol_test/, then run from packages/patrol/example:

dart run ../../patrol_cli/bin/main.dart \
  --flutter-command=/path/to/flutter/3.47/bin/flutter \
  test \
  --device=<ios-simulator-uuid> \
  --target=patrol_test/diagnostic_collection_repro_test.dart \
  --verbose

Verified result with Xcode's default diagnostic policy:

  1. All 61 XCTest cases pass in 954 seconds.

  2. The command does not return after the passing suite.

  3. xcodebuild starts:

    simctl diagnose -l -b --timeout=600 ...
    
  4. The post-test diagnostic phase lasts up to another 10 minutes.

The same generated .xctestrun has DiagnosticCollectionPolicy = 1. Setting it to 0 (Never) before xcodebuild test-without-building prevents the diagnostic phase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment