Skip to content

Commit 59fa037

Browse files
committed
fix crash on frontend server when restarting without a reload first
1 parent 6e13c44 commit 59fa037

2 files changed

Lines changed: 20 additions & 29 deletions

File tree

dwds/test/frontend_server_common/devfs.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ class WebDevFS {
173173
}
174174

175175
assetServer.writeFile('main_module.digests', '{}');
176+
// Write an empty array of scripts to reload to handle the case where
177+
// a test triggers a hot restart before any other action.
178+
assetServer.writeFile('reloaded_sources.json', '[]');
176179

177180
final sdk = dartSdk;
178181
final sdkSourceMap = dartSdkSourcemap;

dwds/test/integration/events_common.dart

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -386,35 +386,23 @@ void testWithDwds({
386386
});
387387
});
388388

389-
group(
390-
'hotRestart',
391-
() {
392-
setUp(() async {
393-
setCurrentLogWriter(debug: provider.verbose);
394-
});
395-
396-
test('emits HOT_RESTART event', () async {
397-
final hotRestart = context.getRegisteredServiceExtension(
398-
'hotRestart',
399-
);
400-
await context.recompile(fullRestart: true);
401-
await expectEventDuring(
402-
matchesEvent(DwdsEventKind.hotRestart, {
403-
'elapsedMilliseconds': isNotNull,
404-
}),
405-
() => fakeClient.callServiceExtension(hotRestart!),
406-
);
407-
});
408-
},
409-
410-
skip:
411-
// Windows is only here to ensure the skip on the outer group gets
412-
// applied.
413-
// https://github.com/dart-lang/webdev/issues/1852
414-
Platform.isWindows ||
415-
// https://github.com/dart-lang/build/issues/4928
416-
compilationMode == CompilationMode.buildDaemon,
417-
);
389+
group('hotRestart', () {
390+
setUp(() async {
391+
setCurrentLogWriter(debug: provider.verbose);
392+
});
393+
394+
test('emits HOT_RESTART event', () async {
395+
final hotRestart = context.getRegisteredServiceExtension(
396+
'hotRestart',
397+
);
398+
await expectEventDuring(
399+
matchesEvent(DwdsEventKind.hotRestart, {
400+
'elapsedMilliseconds': isNotNull,
401+
}),
402+
() => fakeClient.callServiceExtension(hotRestart!),
403+
);
404+
});
405+
});
418406

419407
group('resume', () {
420408
late VmServiceInterface service;

0 commit comments

Comments
 (0)