Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion dart/test/sentry_test.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:isolate';

import 'package:sentry/sentry.dart';
import 'package:sentry/src/dart_exception_type_identifier.dart';
Expand Down Expand Up @@ -412,7 +413,37 @@ void main() {
);
expect(options.debug, isFalse);
});
});

test('isolate completes when closing sentry', () async {
final onExit = ReceivePort();

Future<void> _runSentry(String message) async {
await Sentry.init((options) {
options
..dsn = fakeDsn
..tracesSampleRate = 1.0;
});
await Sentry.close();
}

final completer = Completer<void>();

await Isolate.spawn<String>(
_runSentry,
'test',
onExit: onExit.sendPort,
);

var completed = false;
onExit.listen((message) {
completed = true;
completer.complete();
});

await completer.future;
expect(completed, true);
});
}, testOn: 'vm');

test('should complete when appRunner is not called in runZonedGuarded',
() async {
Expand Down
Loading