mirror of
https://github.com/zoriya/flood.git
synced 2026-05-29 18:04:10 +00:00
Revert "server: tests: remove db cleanup workaround"
This reverts commit 365d82755f.
This commit is contained in:
@@ -49,7 +49,11 @@ const startFlood = () => {
|
||||
|
||||
const closeProcesses = () => {
|
||||
floodProcess.on('close', () => {
|
||||
fs.rmdirSync(temporaryRuntimeDirectory, {recursive: true});
|
||||
if (process.env.CI !== 'true') {
|
||||
// TODO: This leads to test flakiness caused by ENOENT error
|
||||
// NeDB provides no method to close database connection
|
||||
fs.rmdirSync(temporaryRuntimeDirectory, {recursive: true});
|
||||
}
|
||||
});
|
||||
|
||||
floodProcess.kill('SIGTERM');
|
||||
|
||||
@@ -11,5 +11,9 @@ process.argv.push('--auth', 'default');
|
||||
process.argv.push('--assets', 'false');
|
||||
|
||||
afterAll(() => {
|
||||
fs.rmdirSync(temporaryRuntimeDirectory, {recursive: true});
|
||||
if (process.env.CI !== 'true') {
|
||||
// TODO: This leads to test flakiness caused by ENOENT error
|
||||
// NeDB provides no method to close database connection
|
||||
fs.rmdirSync(temporaryRuntimeDirectory, {recursive: true});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -31,6 +31,10 @@ process.argv.push('--assets', 'false');
|
||||
|
||||
afterAll((done) => {
|
||||
process.kill(Number(fs.readFileSync(`${temporaryRuntimeDirectory}/rtorrent.pid`).toString()));
|
||||
fs.rmdirSync(temporaryRuntimeDirectory, {recursive: true});
|
||||
if (process.env.CI !== 'true') {
|
||||
// TODO: This leads to test flakiness caused by ENOENT error
|
||||
// NeDB provides no method to close database connection
|
||||
fs.rmdirSync(temporaryRuntimeDirectory, {recursive: true});
|
||||
}
|
||||
done();
|
||||
});
|
||||
|
||||
@@ -43,7 +43,11 @@ process.argv.push('--assets', 'false');
|
||||
|
||||
afterAll((done) => {
|
||||
transmissionProcess.on('close', () => {
|
||||
fs.rmdirSync(temporaryRuntimeDirectory, {recursive: true});
|
||||
if (process.env.CI !== 'true') {
|
||||
// TODO: This leads to test flakiness caused by ENOENT error
|
||||
// NeDB provides no method to close database connection
|
||||
fs.rmdirSync(temporaryRuntimeDirectory, {recursive: true});
|
||||
}
|
||||
done();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user