mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-25 09:03:12 +03:00
Fixed warning about aborted connection in tests
refs https://github.com/TryGhost/Toolbox/issues/389 - if we enable warning logs in E2E tests, we get a bunch of error messages saying `ERROR Unhandled rejection: aborted` coming from the SQLite DB reset code - specifically, it's coming from the line that resets the DB by copying the file - this line was initially added because we would see random SQLite "malformed database" errors - I have a feeling that was due to something else, but I can't be sure - I'm also not sure how else we should shut the DB connection, as this is the recommended way but it throws an unhandled rejection - this commit is a bit of a gamble because I'm not actually sure what was causing the problem, but it gets rid of the errors locally and doesn't regress on the random failures
This commit is contained in:
parent
f04666ef52
commit
c2b399fc2c
@ -48,7 +48,6 @@ module.exports.reset = async ({truncate} = {truncate: false}) => {
|
||||
const filenameOrig = `${filename}-orig`;
|
||||
|
||||
if (dbInitialized) {
|
||||
await db.knex.destroy();
|
||||
await fs.copyFile(filenameOrig, filename);
|
||||
} else {
|
||||
await fs.remove(filename);
|
||||
|
Loading…
Reference in New Issue
Block a user