Skip to content

test(integration): fix flaky tests for review_after column

Suleimi Ahmed requested to merge 823-fix-flaky-test-delete-manifest into master

Related to #832 (closed), #902 (closed) & #830 (closed) and #819 (closed)

Why?

This should fix all tests that fail because of timing inconsistencies when a db trigger schedules a review record in any of the gc review tables.

Context

We introduced a random jitter for reviewing records that have the potential to be garbage collected here. However, the jitter introduced in the linked commit could result in any value that was >= 5 and < 61 seconds rather than the intended (or expected) values that are >= 5 and =< 60 seconds.

This means values less than 60 seconds and 999.999... milliseconds but greater than 60 seconds are valid, hence why our test occasionally fail.

The specific cases for test failures are when we are expecting the "jitter'd" review_after time that was triggered by the database to be within the >= 5 and =< 60 seconds range but the database trigger instead falls within the > 60 and < 61 seconds range.

Possible Solutions

  1. Fix the trigger that inserts the review_after jitter, so that it is bound to >= 5 and =< 60 and not >= 5 and < 61
  2. Patch the test to also take into account the values that are > 60 and < 61

Solution Implemented

Since this problem only affects tests and does not necessarily degrade the performance of the registry or change drastically the expected outcomes of the registry, i've opted for solution 2 here.

Edited by Jaime Martinez

Merge request reports