Skip to content

Feature request for Miniflare 3: Ability to wait for request context death #5258

Open

Description

@vlovich

It can be useful to write tests where you assert certain behavior after you know that all waitUntil tasks have completed (e.g. you want to assert background logs were generated correctly). To do so, there needs to be some mechanism between workerd and Miniflare to enable this.

Option 1: Per-request await. There's some API that lets you know when the request context for a given response has died (e.g. maybe an extra parameter in the cf object like resp.cf.requestContextDeath?

Option 2: Wait for all request contexts to be dead within workerd.

Option 1 is the most flexible and let's you write very precise tests (option 2 can be implemented in terms of option 1 without extra workerd machinery).

Option 2 is probably a good enough MVP to enable all interesting tests and might be the more palatable option from the workerd perspective (not 100% sure).

Activity

  1. mrbbot commented on Nov 7, 2023

    @mrbbot
    Contributor

    Hey! 👋 I'm going to transfer this to workers-sdk as that's the new home for Miniflare 3, and that will make it easier for us to track this. This probably still needs support from workerd though. 👍

  2. transferred this issue fromcloudflare/miniflareon Nov 7, 2023
  3. moved this from Untriaged to Other in workers-sdkon Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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