@@ -41,29 +41,29 @@ void main() {
41
41
}
42
42
});
43
43
test ('can be stopped' , () async {
44
- final workspace = generateV4UUID ();
44
+ final workspace = randomWorkspace ();
45
45
testWorkspaces.add (workspace);
46
46
final daemon = Daemon (workspace);
47
47
await daemon.start (< String > {}, FakeDaemonBuilder (), FakeChangeProvider ());
48
48
expect (daemon.onDone, completes);
49
49
await daemon.stop ();
50
50
});
51
51
test ('can run if no other daemon is running' , () async {
52
- final workspace = generateV4UUID ();
52
+ final workspace = randomWorkspace ();
53
53
final daemon = await _runDaemon (workspace);
54
54
testDaemons.add (daemon);
55
55
expect (await _statusOf (daemon), 'RUNNING' );
56
56
});
57
57
test ('shuts down if no client connects' , () async {
58
- final workspace = generateV4UUID ();
58
+ final workspace = randomWorkspace ();
59
59
final daemon = await _runDaemon (workspace, timeout: 1 );
60
60
testDaemons.add (daemon);
61
61
expect (await daemon.exitCode, isNotNull);
62
62
});
63
63
test (
64
64
'can not run if another daemon is running in the same workspace' ,
65
65
() async {
66
- final workspace = generateV4UUID ();
66
+ final workspace = randomWorkspace ();
67
67
testWorkspaces.add (workspace);
68
68
final daemonOne = await _runDaemon (
69
69
workspace,
@@ -79,8 +79,8 @@ void main() {
79
79
test (
80
80
'can run if another daemon is running in a different workspace' ,
81
81
() async {
82
- final workspace1 = generateV4UUID ();
83
- final workspace2 = generateV4UUID ();
82
+ final workspace1 = randomWorkspace ();
83
+ final workspace2 = randomWorkspace ();
84
84
testWorkspaces.addAll ([workspace1, workspace2]);
85
85
final daemonOne = await _runDaemon (workspace1);
86
86
expect (await _statusOf (daemonOne), 'RUNNING' );
@@ -91,7 +91,7 @@ void main() {
91
91
timeout: const Timeout .factor (2 ),
92
92
);
93
93
test ('can start two daemons at the same time' , () async {
94
- final workspace = generateV4UUID ();
94
+ final workspace = randomWorkspace ();
95
95
testWorkspaces.add (workspace);
96
96
final daemonOne = await _runDaemon (workspace);
97
97
expect (await _statusOf (daemonOne), 'RUNNING' );
@@ -100,20 +100,20 @@ void main() {
100
100
testDaemons.addAll ([daemonOne, daemonTwo]);
101
101
}, timeout: const Timeout .factor (2 ));
102
102
test ('logs the version when running' , () async {
103
- final workspace = generateV4UUID ();
103
+ final workspace = randomWorkspace ();
104
104
testWorkspaces.add (workspace);
105
105
final daemon = await _runDaemon (workspace);
106
106
testDaemons.add (daemon);
107
107
expect (await _statusOf (daemon), 'RUNNING' );
108
108
expect (await Daemon (workspace).runningVersion (), currentVersion);
109
109
});
110
110
test ('does not set the current version if not running' , () async {
111
- final workspace = generateV4UUID ();
111
+ final workspace = randomWorkspace ();
112
112
testWorkspaces.add (workspace);
113
113
expect (await Daemon (workspace).runningVersion (), null );
114
114
});
115
115
test ('logs the options when running' , () async {
116
- final workspace = generateV4UUID ();
116
+ final workspace = randomWorkspace ();
117
117
testWorkspaces.add (workspace);
118
118
final daemon = await _runDaemon (workspace);
119
119
testDaemons.add (daemon);
@@ -124,12 +124,12 @@ void main() {
124
124
);
125
125
});
126
126
test ('does not log the options if not running' , () async {
127
- final workspace = generateV4UUID ();
127
+ final workspace = randomWorkspace ();
128
128
testWorkspaces.add (workspace);
129
129
expect ((await Daemon (workspace).currentOptions ()).isEmpty, isTrue);
130
130
});
131
131
test ('cleans up after itself' , () async {
132
- final workspace = generateV4UUID ();
132
+ final workspace = randomWorkspace ();
133
133
testWorkspaces.add (workspace);
134
134
final daemon = await _runDaemon (workspace);
135
135
// Wait for the daemon to be running before checking the workspace exits.
@@ -141,7 +141,7 @@ void main() {
141
141
expect (Directory (daemonWorkspace (workspace)).existsSync (), isFalse);
142
142
});
143
143
test ('daemon stops after file changes stream has error' , () async {
144
- final workspace = generateV4UUID ();
144
+ final workspace = randomWorkspace ();
145
145
testWorkspaces.add (workspace);
146
146
final daemon = await _runDaemon (
147
147
workspace,
@@ -152,7 +152,7 @@ void main() {
152
152
expect (Directory (daemonWorkspace (workspace)).existsSync (), isFalse);
153
153
});
154
154
test ('daemon stops after file changes stream is closed' , () async {
155
- final workspace = generateV4UUID ();
155
+ final workspace = randomWorkspace ();
156
156
testWorkspaces.add (workspace);
157
157
final daemon = await _runDaemon (
158
158
workspace,
0 commit comments