Skip to content

Test cancellation with synchronization rather than timing #58

@nikomatsakis

Description

@nikomatsakis

Problem

The cancellation test in vscode-extension/src/test/cancellation.test.ts is currently skipped because it's timing-dependent. The test sends two prompts and expects the second to cancel the first, but ElizACP responds so fast that the first prompt completes before the second arrives.

Proposed Solution

Use an MCP server that ElizACP can call back to, which blocks until cancellation has been sent:

  1. Create a test MCP server with a tool like wait_for_signal
  2. When ElizACP receives the first prompt, it calls this tool which blocks
  3. The test sends the second prompt (triggering cancellation)
  4. The MCP server unblocks after seeing the cancellation
  5. Test verifies the cancellation was properly sent

This turns a timing-dependent test into a synchronization-based test that's reliable regardless of how fast the agent responds.

Current Workaround

The test is marked with test.skip with a TODO comment pointing to this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions