Skip to content

Commit 26375b6

Browse files
Try really long timeout
1 parent c74ab4f commit 26375b6

File tree

2 files changed

+86
-84
lines changed

2 files changed

+86
-84
lines changed

packages/flutter_test_runners/example_deep_links/test_driver/deep_link_ios_test.dart

Lines changed: 84 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'dart:io';
22

3+
import 'package:flutter_test_runners/flutter_test_runners.dart';
34
import 'package:test/test.dart';
45

56
void main() {
@@ -44,90 +45,90 @@ void main() {
4445
// print("The xcrun call returned with exit code: ${result.exitCode}");
4546
// });
4647

47-
test("Send terminate command to simulator", () async {
48-
print("Running device list command:");
49-
final result1 = await Process.run(
50-
"sh",
51-
[
52-
"-c",
53-
"xcrun simctl list",
54-
],
55-
);
56-
print("result1: ${result1.exitCode}");
57-
print("");
58-
59-
print("Running get_app_container command:");
60-
final result2 = await Process.run(
61-
"sh",
62-
[
63-
"-c",
64-
"xcrun simctl get_app_container booted com.flutterbountyhunters.deeplinks.example",
65-
],
66-
);
67-
print("result2: ${result2.exitCode}");
68-
print("");
69-
70-
//--------
71-
print("Sending xcrun simctl terminate command...");
72-
73-
// CI Timeout
74-
// final process = await Process.start(
75-
// "xcrun",
76-
// ["simctl", "terminate", "booted", "'$appBundleId'"],
77-
// runInShell: true,
78-
// );
79-
80-
// CI Timeout
81-
// final process = await Process.start(
82-
// "xcrun",
83-
// ["simctl", "terminate", "booted", "'$appBundleId'"],
84-
// );
85-
86-
// CI Timeout
87-
// final process = await Process.start(
88-
// "sh",
89-
// ["-c", "xcrun simctl terminate booted '$appBundleId'"],
90-
// );
91-
//
92-
// CI Timeout
93-
// final result = await Process.run(
94-
// "sh",
95-
// ["-c", "xcrun simctl terminate booted '$appBundleId'"],
96-
// );
97-
// print("Exit code: ${result.exitCode}");
98-
99-
// CI Timeout
100-
// final script = '''
101-
// #!/bin/bash
102-
// xcrun simctl terminate booted $appBundleId
103-
// ''';
104-
// final tempFile = File('/tmp/temp_script.sh');
105-
// await tempFile.writeAsString(script);
106-
// await Process.run('chmod', ['+x', tempFile.path]);
107-
// final process = await Process.start('/bin/bash', [tempFile.path]);
108-
//
109-
// print("terminate command process was started");
110-
//
111-
// process.stdin.close();
112-
//
113-
// stdout.addStream(process.stdout);
114-
// stderr.addStream(process.stderr);
115-
//
116-
// print("Waiting for exit code...");
117-
// final exitCode = await process.exitCode;
118-
// print("Killed app - exit code: $exitCode");
119-
});
48+
// test("Send terminate command to simulator", () async {
49+
// print("Running device list command:");
50+
// final result1 = await Process.run(
51+
// "sh",
52+
// [
53+
// "-c",
54+
// "xcrun simctl list",
55+
// ],
56+
// );
57+
// print("result1: ${result1.exitCode}");
58+
// print("");
59+
//
60+
// print("Running get_app_container command:");
61+
// final result2 = await Process.run(
62+
// "sh",
63+
// [
64+
// "-c",
65+
// "xcrun simctl get_app_container booted com.flutterbountyhunters.deeplinks.example",
66+
// ],
67+
// );
68+
// print("result2: ${result2.exitCode}");
69+
// print("");
70+
//
71+
// //--------
72+
// print("Sending xcrun simctl terminate command...");
73+
//
74+
// // CI Timeout
75+
// // final process = await Process.start(
76+
// // "xcrun",
77+
// // ["simctl", "terminate", "booted", "'$appBundleId'"],
78+
// // runInShell: true,
79+
// // );
80+
//
81+
// // CI Timeout
82+
// // final process = await Process.start(
83+
// // "xcrun",
84+
// // ["simctl", "terminate", "booted", "'$appBundleId'"],
85+
// // );
86+
//
87+
// // CI Timeout
88+
// // final process = await Process.start(
89+
// // "sh",
90+
// // ["-c", "xcrun simctl terminate booted '$appBundleId'"],
91+
// // );
92+
// //
93+
// // CI Timeout
94+
// // final result = await Process.run(
95+
// // "sh",
96+
// // ["-c", "xcrun simctl terminate booted '$appBundleId'"],
97+
// // );
98+
// // print("Exit code: ${result.exitCode}");
99+
//
100+
// // CI Timeout
101+
// // final script = '''
102+
// // #!/bin/bash
103+
// // xcrun simctl terminate booted $appBundleId
104+
// // ''';
105+
// // final tempFile = File('/tmp/temp_script.sh');
106+
// // await tempFile.writeAsString(script);
107+
// // await Process.run('chmod', ['+x', tempFile.path]);
108+
// // final process = await Process.start('/bin/bash', [tempFile.path]);
109+
// //
110+
// // print("terminate command process was started");
111+
// //
112+
// // process.stdin.close();
113+
// //
114+
// // stdout.addStream(process.stdout);
115+
// // stderr.addStream(process.stderr);
116+
// //
117+
// // print("Waiting for exit code...");
118+
// // final exitCode = await process.exitCode;
119+
// // print("Killed app - exit code: $exitCode");
120+
// });
120121

121-
// testDeepLinkIosAppLaunch(
122-
// "home screen",
123-
// appBundleId: appBundleId,
124-
// deepLink: "https://deeplinks.flutterbountyhunters.com",
125-
// verbose: true,
126-
// (driver) async {
127-
// await driver.waitFor(find.text("Home Screen"));
128-
// await Future.delayed(const Duration(seconds: 3));
129-
// },
130-
// );
122+
testDeepLinkIosAppLaunch(
123+
"home screen",
124+
appBundleId: appBundleId,
125+
deepLink: "https://deeplinks.flutterbountyhunters.com",
126+
verbose: true,
127+
(driver) async {
128+
await driver.waitFor(find.text("Home Screen"));
129+
await Future.delayed(const Duration(seconds: 3));
130+
},
131+
);
131132

132133
// testDeepLinkIosAppLaunch(
133134
// "sign-up screen",

packages/flutter_test_runners/lib/src/deep_links/deep_links_ios.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ void testDeepLinkIosAppLaunch(
2424
required String appBundleId,
2525
required String deepLink,
2626
bool verbose = false,
27+
Duration timeout = const Duration(minutes: 5),
2728
}) {
2829
test(description, () async {
2930
_initLogs(verbose);
@@ -132,7 +133,7 @@ void testDeepLinkIosAppLaunch(
132133

133134
// Run the test.
134135
await testRunner(driver);
135-
});
136+
}, timeout: Timeout(timeout));
136137
}
137138

138139
Future<void> _logVmDetailsAfterConnectionFailure(String dartVmService) async {

0 commit comments

Comments
 (0)