Skip to content

test(GlOutside): Reduce flakiness

Mark Florian requested to merge fix-flaky-outside-specs into main

What does this MR do?

test(GlOutside): Reduce flakiness

The GlOutsideDirective works around an edge case by comparing event timestamps, similarly to what Vue itself does. While the tests were written to avoid flakiness by building in delays to ensure different event timestamps it turns out that:

  1. Delaying by 1ms appears to be insufficient to guarantee different event timestamps.
  2. The delay helper was written incorrectly, implicitly passing 0 to setTimeout.

This commit addresses both of these, and should practically eliminate the flakiness of these tests.

It's worth noting that #1426 (closed) may remove the need for this inherently flaky reliance on timestamps.

Addresses #1425 (closed).

Does this MR meet the acceptance criteria?

Conformity

  • Code review guidelines.
  • GitLab UI's contributing guidlines.
  • [-] If it changes a Pajamas-compliant component's look & feel, the MR has been reviewed by a UX designer.
  • [-] If it changes GitLab UI's documentation guidelines, the MR has been reviewed by a Technical Writer.
  • [-] If the MR changes a component's API, integration MR(s) have been opened in the following projects to ensure that the @gitlab/ui package can be upgraded quickly after the changes are released:
  • [-] Added the ~"component:*" label(s) if applicable.
Edited by Mark Florian

Merge request reports