1. 11 Mar, 2022 2 commits
    • Thong Kuah's avatar
      1d5c9729
    • Thong Kuah's avatar
      Always set GITLAB_USE_MODEL_LOAD_BALANCING in test env · 3d5df5b0
      Thong Kuah authored
      Otherwise in request specs, we will create factories in one connection
      (main), while trying to access records in another connection (ci) while
      running in a controller. This is because SafeRequestStore is not active
      in the first situation but is active in the other.
      
      This possibly is a problem with feature specs as well. This is only a
      problem when ci database is configured,
      
      To fix this, we always set GITLAB_USE_MODEL_LOAD_BALANCING to a non-nil
      value so that we consistently use the same connection. We already set
      GITLAB_USE_MODEL_LOAD_BALANCING to true anyway in CI, so let's set that
      for all test environments.
      
      This env var is not used in single database setups, so it shouldn't
      affect single database setups
      3d5df5b0
  2. 10 Mar, 2022 38 commits