Skip to content

Commit

Permalink
Only use one nginx worker, add a slight wait post-nginx-reload, to pr…
Browse files Browse the repository at this point in the history
…operly upgrade-test schema changes that aren't backward-compatible on the "get enroll secret" code path (#26008)

For #26003. Will add more context to that ticket.

This is a robustness fix to the upgrade test, which pulls tags/branches
from Docker, so this does _not_ need to be cherry-picked.

To confirm this fix, run the upgrade test from <4.63.0 to >= 4.63.0 and
see it pass rather than fail.

# Checklist for submitter
- [x] Added/updated automated tests
- [x] A detailed QA plan exists on the associated ticket (if it isn't
there, work with the product group's QA engineer to add it)
- [x] Manual QA for all new/changed functionality
  • Loading branch information
iansltx authored Feb 4, 2025
1 parent ee47556 commit f4f249a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/upgrade/fleet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ func (f *Fleet) Start() error {
return err
}

// drop to one nginx worker process regardless of CPU count to ensure repointing to the correct
// Fleet container happens quickly
_, err = f.execCompose(env, "exec", "-T", "fleet", "sed", "-i", "s/auto/1/", "/etc/nginx/nginx.conf")
if err != nil {
return err
}

_, err = f.execCompose(env, "exec", "-T", "fleet", "nginx", "-s", "reload")
if err != nil {
return err
Expand Down Expand Up @@ -361,6 +368,10 @@ func (f *Fleet) Upgrade(toVersion string) error {
return err
}

// even with only one worker process, graceful reload of nginx workers doesn't happen instantly,
// so we add a wait here to let workers swap so they're pointed at the upgraded Fleet server
time.Sleep(250 * time.Millisecond)

f.Version = toVersion

return nil
Expand Down

0 comments on commit f4f249a

Please sign in to comment.