Skip to content

Commit 9c841df

Browse files
authored
Improve slow integration tests. (#4213)
1 parent 6020e10 commit 9c841df

29 files changed

+446
-924
lines changed

.github/workflows/dart.yml

Lines changed: 155 additions & 261 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build_daemon/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
- Bump the min SDK to 3.7.0.
44
- Remove unused dep: `analyzer`.
5+
- Add `connectUnchecked` for use in tests.
56

67
## 4.0.4
78

build_daemon/lib/client.dart

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ class BuildDaemonClient {
169169

170170
/// Connects to the current daemon instance.
171171
///
172+
/// The options of the running daemon are checked against [daemonCommand].
173+
/// If there is a mismatch, an exception is thrown.
174+
///
172175
/// If one is not running, a new daemon instance will be started.
173176
static Future<BuildDaemonClient> connect(
174177
String workingDirectory,
@@ -180,8 +183,6 @@ class BuildDaemonClient {
180183
BuildMode buildMode = BuildMode.Auto,
181184
}) async {
182185
logHandler ??= (_) {};
183-
final daemonSerializers = serializersOverride ?? serializers;
184-
185186
final daemonArgs = daemonCommand.sublist(1)
186187
..add('--$buildModeFlag=$buildMode');
187188

@@ -196,6 +197,26 @@ class BuildDaemonClient {
196197

197198
await _handleDaemonStartup(process, logHandler);
198199

200+
return connectUnchecked(
201+
workingDirectory,
202+
serializersOverride: serializersOverride,
203+
logHandler: logHandler,
204+
);
205+
}
206+
207+
/// Connects to the current daemon instance.
208+
///
209+
/// Does not check the options the daemon is running with, so this is
210+
/// primarily useful in tests where the daemon has just been launched.
211+
///
212+
/// To connect and check the options, use [connect].
213+
static Future<BuildDaemonClient> connectUnchecked(
214+
String workingDirectory, {
215+
Serializers? serializersOverride,
216+
void Function(ServerLog)? logHandler,
217+
}) async {
218+
logHandler ??= (_) {};
219+
final daemonSerializers = serializersOverride ?? serializers;
199220
return BuildDaemonClient._(
200221
await _existingPort(workingDirectory),
201222
daemonSerializers,

build_runner/dart_test.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ presets:
33
include_tags: experiments
44

55
tags:
6-
slow:
7-
timeout: 16x
8-
integration:
6+
integration1:
7+
timeout: 4x
8+
integration2:
9+
timeout: 4x
10+
integration3:
911
timeout: 4x
1012
experiments:
1113
skip: 'Only ran if `-P experiments` is passed'

build_runner/mono_pkg.yaml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,19 @@ stages:
99
- format
1010
- analyze: --fatal-infos .
1111
- unit_test:
12-
- test: -x integration -x slow --test-randomize-ordering-seed=random
12+
- test: -x integration1 -x integration2 -x integration3 --test-randomize-ordering-seed=random
1313
- test: -P experiments --test-randomize-ordering-seed=random
14-
- test: -t integration --test-randomize-ordering-seed=random
14+
- test: -t integration1 --test-randomize-ordering-seed=random
15+
os:
16+
- linux
17+
- windows
18+
- test: -t integration2 --test-randomize-ordering-seed=random
19+
os:
20+
- linux
21+
- windows
22+
- test: -t integration3 --test-randomize-ordering-seed=random
1523
os:
1624
- linux
1725
- windows
1826
- leak_check:
1927
- command: ../tool/leak_check.sh
20-
- e2e_test:
21-
- test: -t slow --total-shards 5 --shard-index 0 --test-randomize-ordering-seed=random -j 1
22-
- test: -t slow --total-shards 5 --shard-index 1 --test-randomize-ordering-seed=random -j 1
23-
- test: -t slow --total-shards 5 --shard-index 2 --test-randomize-ordering-seed=random -j 1
24-
- test: -t slow --total-shards 5 --shard-index 3 --test-randomize-ordering-seed=random -j 1
25-
- test: -t slow --total-shards 5 --shard-index 4 --test-randomize-ordering-seed=random -j 1

0 commit comments

Comments
 (0)