Revert "server: tests: remove db cleanup workaround"

This reverts commit 365d82755f.
This commit is contained in:
Jesse Chan
2022-05-01 15:39:34 -07:00
parent 365d82755f
commit edbb9c1ea7
4 changed files with 20 additions and 4 deletions
+5 -1
View File
@@ -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');
+5 -1
View File
@@ -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});
}
});
+5 -1
View File
@@ -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();
});
+5 -1
View File
@@ -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();
});