Skip to content

Commit

Permalink
Increase timeout on waiting for debugging to start in e2e tests (#107)
Browse files Browse the repository at this point in the history
* Increase timeout on waiting for debugging to start in e2e tests

* ..

* Try

* ..
  • Loading branch information
infiniteregrets authored Feb 21, 2024
1 parent 8d929f8 commit acd761f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
1 change: 1 addition & 0 deletions changelog.d/+increase-timeout.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Increase timeout on waiting for debugging to start in e2e tests
23 changes: 11 additions & 12 deletions src/tests/e2e.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect } from "chai";
import { expect, assert } from "chai";
import { join } from "path";
import { VSBrowser, StatusBar, ActivityBar, DebugView, InputBox, DebugToolbar, BottomBarPanel, EditorView } from "vscode-extension-tester";
import get from "axios";
Expand All @@ -15,7 +15,7 @@ const podToSelect = process.env.POD_TO_SELECT;
* - Send traffic to the pod
* - Tests successfully exit if "GET: Request completed" is found in the terminal
*/
describe("mirrord sample flow test", function() {
describe("mirrord sample flow test", function () {

this.timeout("6 minutes"); // --> mocha tests timeout
this.bail(true); // --> stop tests on first failure
Expand All @@ -26,7 +26,7 @@ describe("mirrord sample flow test", function() {
const fileName = "app_flask.py";
const defaultTimeout = 10000; // = 10 seconds

before(async function() {
before(async function () {
console.log("podToSelect: " + podToSelect);
console.log("kubeService: " + kubeService);

Expand All @@ -48,7 +48,7 @@ describe("mirrord sample flow test", function() {
await ew.openEditor('app_flask.py');
});

it("enable mirrord button", async function() {
it("enable mirrord button", async function () {
const statusBar = new StatusBar();

await browser.driver.wait(async () => {
Expand Down Expand Up @@ -80,7 +80,7 @@ describe("mirrord sample flow test", function() {
}, defaultTimeout, "mirrord `enable` button not found -- timed out");
});

it("select pod from quickpick", async function() {
it("select pod from quickpick", async function () {
await startDebugging();
const inputBox = await InputBox.create(defaultTimeout * 2);
// assertion that podToSelect is not undefined is done in "before" block
Expand Down Expand Up @@ -108,20 +108,19 @@ describe("mirrord sample flow test", function() {
await inputBox.selectQuickPick(podToSelect!);
});

it("wait for process to write to terminal", async function() {
const debugToolbar = await DebugToolbar.create(2 * defaultTimeout);
const panel = new BottomBarPanel();
await browser.driver.wait(async () => {
return await debugToolbar.isDisplayed();
}, 4 * defaultTimeout, "debug toolbar not found -- timed out");
it("wait for process to write to terminal", async function () {
const debugToolbar = await DebugToolbar.create(4 * defaultTimeout);

assert.isTrue(await debugToolbar.isDisplayed(), "Debug toolbar not found");

const panel = new BottomBarPanel();

let terminal = await panel.openTerminalView();

await browser.driver.wait(async () => {
const text = await terminal.getText();
return await terminal.isDisplayed() && text.includes("Press CTRL+C to quit");
}, 2 * defaultTimeout, "terminal text not found -- timed out");
}, 4 * defaultTimeout, "terminal text not found -- timed out");

await sendTrafficToPod();

Expand Down

0 comments on commit acd761f

Please sign in to comment.