Skip to content

Commit

Permalink
server: tests: remove db cleanup workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
jesec committed May 1, 2022
1 parent e09accd commit 365d827
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 20 deletions.
6 changes: 1 addition & 5 deletions scripts/testsetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,7 @@ const startFlood = () => {

const closeProcesses = () => {
floodProcess.on('close', () => {
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});
}
fs.rmdirSync(temporaryRuntimeDirectory, {recursive: true});
});

floodProcess.kill('SIGTERM');
Expand Down
6 changes: 1 addition & 5 deletions server/.jest/auth.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,5 @@ process.argv.push('--auth', 'default');
process.argv.push('--assets', 'false');

afterAll(() => {
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});
}
fs.rmdirSync(temporaryRuntimeDirectory, {recursive: true});
});
6 changes: 1 addition & 5 deletions server/.jest/rtorrent.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ process.argv.push('--assets', 'false');

afterAll((done) => {
process.kill(Number(fs.readFileSync(`${temporaryRuntimeDirectory}/rtorrent.pid`).toString()));
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});
}
fs.rmdirSync(temporaryRuntimeDirectory, {recursive: true});
done();
});
6 changes: 1 addition & 5 deletions server/.jest/transmission.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@ process.argv.push('--assets', 'false');

afterAll((done) => {
transmissionProcess.on('close', () => {
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});
}
fs.rmdirSync(temporaryRuntimeDirectory, {recursive: true});
done();
});

Expand Down

0 comments on commit 365d827

Please sign in to comment.