Skip to content

Fix flaky test: Use a stubbed value for the CustomerDot JWT token

Rutger Wessels requested to merge 468344-fix-flaky-test-billing-account into master

What does this MR do and why?

The spec is failing because the CustomerDot JWT tokens do not match. This can happen when the test runs in another second than the test setup. For example:

  • Second 00:00:12.923 -> Test setup creates JWT token
  • Second 00:00:13.001 -> Code under test creates JWT token.

When I add a sleep(1) here, the spec fail consistently.

This MR will ensure the encode method of Gitlab::CustomersDot::Jwt returns the same value both in the test and in the code under test.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #468344 (closed)

Edited by Rutger Wessels

Merge request reports

Loading