fix: prevent database deadlock (eps 2)
This commit is contained in:
@@ -27,7 +27,7 @@ void main() {
|
||||
for (final toVersion in versions.skip(i + 1)) {
|
||||
test('to $toVersion', () async {
|
||||
final schema = await verifier.schemaAt(fromVersion);
|
||||
final db = Drift(schema.newConnection());
|
||||
final db = Drift(executor: schema.newConnection());
|
||||
await verifier.migrateAndValidate(db, toVersion);
|
||||
await db.close();
|
||||
});
|
||||
|
||||
@@ -12,7 +12,7 @@ void main() {
|
||||
late MediumFactory mediumFactory;
|
||||
|
||||
setUp(() {
|
||||
db = Drift(DatabaseConnection(NativeDatabase.memory(), closeStreamsSynchronously: true));
|
||||
db = Drift(executor: DatabaseConnection(NativeDatabase.memory(), closeStreamsSynchronously: true));
|
||||
mediumFactory = MediumFactory(db);
|
||||
});
|
||||
|
||||
|
||||
@@ -62,7 +62,10 @@ void main() {
|
||||
);
|
||||
|
||||
setUpAll(() async {
|
||||
final loggerDb = DriftLogger(DatabaseConnection(NativeDatabase.memory(), closeStreamsSynchronously: true));
|
||||
final loggerDb = DriftLogger(
|
||||
executor: DatabaseConnection(NativeDatabase.memory(), closeStreamsSynchronously: true),
|
||||
shareAcrossIsolates: true,
|
||||
);
|
||||
final LogRepository logRepository = LogRepository(loggerDb);
|
||||
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
Reference in New Issue
Block a user