test(11-08): keep sync failure coverage managed
This commit is contained in:
@@ -611,11 +611,11 @@ func TestSyncFailuresNonFatal(t *testing.T) {
|
|||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
defer env.gdb.Exec(`ALTER TABLE acme_owners_gone RENAME TO acme_owners`)
|
defer env.gdb.Exec(`ALTER TABLE acme_owners_gone RENAME TO acme_owners`)
|
||||||
err := env.gdb.WithContext(ctx).Transaction(func(tx *gorm.DB) error {
|
err := lagoon.Transaction(ctx, env.gdb, func(ctx context.Context, tx *gorm.DB) error {
|
||||||
if err := tx.Create(&Doc{Title: "owner-read-fails"}).Error; err != nil {
|
if err := tx.WithContext(ctx).Create(&Doc{Title: "owner-read-fails"}).Error; err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return tx.Create(&Plain{Name: "still-usable-2"}).Error
|
return tx.WithContext(ctx).Create(&Plain{Name: "still-usable-2"}).Error
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("a failed document read aborted the caller's transaction: %v", err)
|
t.Fatalf("a failed document read aborted the caller's transaction: %v", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user