Use consistent container name for each upgrade step

What does this MR do and why?

During the upgrade tests the seeding phase of the test uses a randomised container name which is then used as hostname for parts of the instance config. Subsequently when we upgrade the instance, we reuse the config, but spin up a new container which has a new name. This causes the instance config to differ from actual hostname.

While today we don't observe any failures in our suite, this is solely due to the minimal set of tests we are actively using in the suite. When we try to run tests such as those that e.g. interact with WebIDE we observe failures due to the hostname not matching the config.

In order to best replicate a realistic upgrade scenario we should keep the container name consistent between runs, so uses a randomized name on the first run, but then reuse the container name/host name for use in later runs.

NB This was initially noted in https://gitlab.com/gitlab-org/gitlab/-/jobs/8147481319 during ongoing work for gitlab-org/quality/quality-engineering/team-tasks#3075 where it manifested in the following shape. Here we can observe that during the seeding run a container name gitlab-ee-78761ad1 was used, but when the later steps run it begins to use a container name gitlab-ee-2366d51a which leads to WebIDE failing to load due to the mismatching configuration of callback URLs. While this is a specific use case, it may be something that is present elsewhere, but as noted the limited test suite that we run here may be masking other similar issues.

Sample Screenshot of Error image

How to set up and validate locally

  • Executing the test jobs in question here should allow for manual verification that existing jobs work.
bundle exec exe/gitlab-qa Test::Omnibus::UpdateFromPrevious EE 17.6.0-pre minor ee 
bundle exec exe/gitlab-qa Test::Omnibus::UpdateFromPrevious EE 17.6.0-pre major ee 
  • In order to verify WebIDE specifically, I found that pausing the docker test container, and the accessing the container directly via browser allowed for manual verification that WebIDE would work in both seeding and 'test' phase. Note also that the gitlab/gitlab-ee container name remains consistent in both the seeding phase, and in each subsequent upgrade step.
➜  gitlab-qa git:(jmd/update-upgrade-test-to-use-consitent-container-names) docker ps
CONTAINER ID   IMAGE                                                 COMMAND                  CREATED          STATUS                   PORTS                                    NAMES
e4a86119f9d6   gitlab/gitlab-ee-qa:nightly                           "bin/test Test::Inst…"   3 minutes ago    Up 3 minutes                                                      gitlab-ee-qa-1a892ce8
e00a4f02c058   gitlab/gitlab-ee:nightly                              "/assets/wrapper"        6 minutes ago    Up 6 minutes (healthy)   22/tcp, 443/tcp, 0.0.0.0:51965->80/tcp   gitlab-updatefromprevious-2b877058

# in this case `docker pause/unpause gitlab-ee-qa-1a892ce8` 

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by John McDonnell

Merge request reports

Loading
Loading