Add a way to delay executions in test runner until terminate event completed in the child site

Created on 20 July 2023, 11 months ago
Updated 6 August 2023, 11 months ago

Problem/Motivation

In 🐛 Post-response task running (destructable services) are actually blocking; add test coverage and warn for common misconfiguration Fixed and 🐛 [random test failure] Random failure in PathWorkspacesTest Fixed several calls to sleep() were introduced in order to mitigate race conditions. The affected browser tests have the following pattern in common:

  1. An alias path is created during some request in the child site.
  2. The response is generated and evaluated by the test runner.
  3. After that the following events can occur in any order:
    • An assertion against the alias path cache is run in the test runner
    • The alias cache is rebuilt during execution of the terminate event in the child site

Steps to reproduce

This is hard, look at the patches in 🐛 [random test failure] Random failure in PathWorkspacesTest Fixed for some ideas.

Proposed resolution

  • Introduce a middleware which is running at a low enough priority to act on the final response
  • From within the middleware, acquire a lock which is automatically released using a shutdown callback. Add a header to the response in order to indicate to the test runner that the lock exists.
  • Add a mechanism to wait for that lock in the existing test http client middleware (if the response header is present)
  • Add a state flag which we can use to enable the middleware from within the test runner
  • Introduce a test trait in order to simplify all that
  • Remove the sleep() from the test cases and instead use the new test trait

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Feature request
Status

Fixed

Version

11.0 🔥

Component
Base 

Last updated 1 minute ago

Created by

🇨🇭Switzerland znerol

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024