Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Cancel Test Run" button in "Test Results" window does not work as expected. #1201

Open
WilcoKruijer opened this issue Oct 31, 2024 · 0 comments

Comments

@WilcoKruijer
Copy link

Describe the bug

The "Cancel Test Run" button is unable to actually stop tests when they are running.

To Reproduce

  1. Have a test that runs for a while (see code example below).
  2. Run the test using the gutter play button.
  3. Go to the "Test Results" window.
  4. Press the "Cancel Test Run" button.
  5. Observe that nothing happens.

Expected behavior

The test is stopped / killed.

Screenshots

image
(Note the square stop button on the right)

Versions

vscode: v1.95.0 deno: v2.0.4 extension: v3.42.0

Example code

import { delay } from "@std/async";

async function* poll(
  signal: AbortSignal,
  intervalMs: number = 100,
): AsyncGenerator<number, void, void> {
  let itt = 0;
  while (!signal.aborted) {
    yield ++itt;

    await delay(intervalMs);
  }
}

Deno.test("test", async () => {
  const controller = new AbortController();
  const signal = controller.signal;

  const generator = poll(signal, 1000);

  for await (const n of generator) {
    console.log(n);

    if (n > 10) {
      controller.abort();
    }
  }
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant