test: reduce flakiness of nzbget and sabnzbd (#1669)
This commit is contained in:
@@ -28,7 +28,7 @@ describe("Nzbget integration", () => {
|
|||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
await startedContainer.stop();
|
await startedContainer.stop();
|
||||||
}, 20_000);
|
}, 30_000);
|
||||||
|
|
||||||
test("Test connection should fail with wrong credentials", async () => {
|
test("Test connection should fail with wrong credentials", async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
@@ -43,7 +43,7 @@ describe("Nzbget integration", () => {
|
|||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
await startedContainer.stop();
|
await startedContainer.stop();
|
||||||
}, 20_000); // Timeout of 20 seconds
|
}, 30_000); // Timeout of 30 seconds
|
||||||
|
|
||||||
test("pauseQueueAsync should work", async () => {
|
test("pauseQueueAsync should work", async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
@@ -60,7 +60,7 @@ describe("Nzbget integration", () => {
|
|||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
await startedContainer.stop();
|
await startedContainer.stop();
|
||||||
}, 20_000); // Timeout of 20 seconds
|
}, 30_000); // Timeout of 30 seconds
|
||||||
|
|
||||||
test("resumeQueueAsync should work", async () => {
|
test("resumeQueueAsync should work", async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
@@ -80,7 +80,7 @@ describe("Nzbget integration", () => {
|
|||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
await startedContainer.stop();
|
await startedContainer.stop();
|
||||||
}, 20_000); // Timeout of 20 seconds
|
}, 30_000); // Timeout of 30 seconds
|
||||||
|
|
||||||
test("Items should be empty", async () => {
|
test("Items should be empty", async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
@@ -98,7 +98,7 @@ describe("Nzbget integration", () => {
|
|||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
await startedContainer.stop();
|
await startedContainer.stop();
|
||||||
}, 20_000); // Timeout of 20 seconds
|
}, 30_000); // Timeout of 30 seconds
|
||||||
|
|
||||||
test("1 Items should exist after adding one", async () => {
|
test("1 Items should exist after adding one", async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
@@ -115,7 +115,7 @@ describe("Nzbget integration", () => {
|
|||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
await startedContainer.stop();
|
await startedContainer.stop();
|
||||||
}, 20_000); // Timeout of 20 seconds
|
}, 30_000); // Timeout of 30 seconds
|
||||||
|
|
||||||
test("Delete item should result in empty items", async () => {
|
test("Delete item should result in empty items", async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
@@ -124,16 +124,18 @@ describe("Nzbget integration", () => {
|
|||||||
const item = await nzbGetAddItemAsync(startedContainer, username, password, nzbGetIntegration);
|
const item = await nzbGetAddItemAsync(startedContainer, username, password, nzbGetIntegration);
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const getAsync = async () => await nzbGetIntegration.getClientJobsAndStatusAsync();
|
|
||||||
const actAsync = async () => await nzbGetIntegration.deleteItemAsync(item, true);
|
const actAsync = async () => await nzbGetIntegration.deleteItemAsync(item, true);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
await expect(actAsync()).resolves.not.toThrow();
|
await expect(actAsync()).resolves.not.toThrow();
|
||||||
await expect(getAsync()).resolves.toMatchObject({ items: [] });
|
// NzbGet is slow and we wait for a second before querying the items. Test was flaky without this.
|
||||||
|
await new Promise((resolve) => setTimeout(resolve, 1000));
|
||||||
|
const result = await nzbGetIntegration.getClientJobsAndStatusAsync();
|
||||||
|
expect(result.items).toHaveLength(0);
|
||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
await startedContainer.stop();
|
await startedContainer.stop();
|
||||||
}, 20_000); // Timeout of 20 seconds*/
|
}, 30_000); // Timeout of 30 seconds
|
||||||
});
|
});
|
||||||
|
|
||||||
const createNzbGetContainer = () => {
|
const createNzbGetContainer = () => {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ describe("Sabnzbd integration", () => {
|
|||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
await startedContainer.stop();
|
await startedContainer.stop();
|
||||||
}, 20_000); // Timeout of 20 seconds
|
}, 30_000); // Timeout of 30 seconds
|
||||||
|
|
||||||
test("Test connection should fail with wrong ApiKey", async () => {
|
test("Test connection should fail with wrong ApiKey", async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
@@ -43,7 +43,7 @@ describe("Sabnzbd integration", () => {
|
|||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
await startedContainer.stop();
|
await startedContainer.stop();
|
||||||
}, 20_000); // Timeout of 20 seconds
|
}, 30_000); // Timeout of 30 seconds
|
||||||
|
|
||||||
test("pauseQueueAsync should work", async () => {
|
test("pauseQueueAsync should work", async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
@@ -60,7 +60,7 @@ describe("Sabnzbd integration", () => {
|
|||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
await startedContainer.stop();
|
await startedContainer.stop();
|
||||||
}, 20_000); // Timeout of 20 seconds
|
}, 30_000); // Timeout of 30 seconds
|
||||||
|
|
||||||
test("resumeQueueAsync should work", async () => {
|
test("resumeQueueAsync should work", async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
@@ -80,7 +80,7 @@ describe("Sabnzbd integration", () => {
|
|||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
await startedContainer.stop();
|
await startedContainer.stop();
|
||||||
}, 20_000); // Timeout of 20 seconds
|
}, 30_000); // Timeout of 30 seconds
|
||||||
|
|
||||||
test("Items should be empty", async () => {
|
test("Items should be empty", async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
@@ -98,7 +98,7 @@ describe("Sabnzbd integration", () => {
|
|||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
await startedContainer.stop();
|
await startedContainer.stop();
|
||||||
}, 20_000); // Timeout of 20 seconds
|
}, 30_000); // Timeout of 30 seconds
|
||||||
|
|
||||||
test("1 Items should exist after adding one", async () => {
|
test("1 Items should exist after adding one", async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
@@ -115,7 +115,7 @@ describe("Sabnzbd integration", () => {
|
|||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
await startedContainer.stop();
|
await startedContainer.stop();
|
||||||
}, 20_000); // Timeout of 20 seconds
|
}, 30_000); // Timeout of 30 seconds
|
||||||
|
|
||||||
test("Pause item should work", async () => {
|
test("Pause item should work", async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
@@ -134,7 +134,7 @@ describe("Sabnzbd integration", () => {
|
|||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
await startedContainer.stop();
|
await startedContainer.stop();
|
||||||
}, 20_000); // Timeout of 20 seconds
|
}, 30_000); // Timeout of 30 seconds
|
||||||
|
|
||||||
test("Resume item should work", async () => {
|
test("Resume item should work", async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
@@ -154,7 +154,7 @@ describe("Sabnzbd integration", () => {
|
|||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
await startedContainer.stop();
|
await startedContainer.stop();
|
||||||
}, 20_000); // Timeout of 20 seconds
|
}, 30_000); // Timeout of 30 seconds
|
||||||
|
|
||||||
test("Delete item should result in empty items", async () => {
|
test("Delete item should result in empty items", async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
@@ -173,7 +173,7 @@ describe("Sabnzbd integration", () => {
|
|||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
await startedContainer.stop();
|
await startedContainer.stop();
|
||||||
}, 20_000); // Timeout of 20 seconds
|
}, 30_000); // Timeout of 30 seconds
|
||||||
});
|
});
|
||||||
|
|
||||||
const createSabnzbdContainer = () => {
|
const createSabnzbdContainer = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user