Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for intermittency in unique job tests that use ByPeriod #395

Merged
merged 1 commit into from
Jun 19, 2024

Commits on Jun 19, 2024

  1. Fix for intermittency in unique job tests that use ByPeriod

    Fix for #392 in which under rare cases, a test can start right up
    against the boundary of a period in use for unique opts, cross over that
    period, and produce the wrong result as a new row is inserted.
    
    For example, using a period of 15 minutes like in `db_unique_test.go`,
    if the tests run at 14:59:59.998, there's a good chance that they'll
    finish after 15:00:00, thereby encapsulating two separate 15 minutes and
    allowing separate jobs to be inserted. This is more likely to happen in
    CI where tests take long to run.
    
    The fix is to use a more stable time for this time of test. We use the
    current hour, but assign a fixed minute and second that's right in the
    middle and nowhere near any boundaries.
    
    I gave `client_test.go`'s unique tests the same treatment since it's
    possible for this problem to happen there too, although they're using a
    24 hour period so it was already very unlikely. (The test case would
    have to start at exactly the wrong moment before a UTC day boundary.)
    
    Fixes #392.
    brandur committed Jun 19, 2024
    Configuration menu
    Copy the full SHA
    4cd66eb View commit details
    Browse the repository at this point in the history