siderolabs / omni

SaaS-simple deployment of Kubernetes - on your own hardware.
Other
395 stars 23 forks source link

test: fix flaky test in `ClusterMachineConfigStatus` unit tests #335

Closed utkuozdemir closed 3 weeks ago

utkuozdemir commented 3 weeks ago

The test TestSchematicChanges was flaky, as it was doing the following:

  1. Trigger one or more factory.talos.dev build image generations & talos node upgrades by modifying resources
  2. Capture these upgrade calls
  3. Assert the build image in these calls (to be one or more with, always the expected image)
  4. Clear captured upgrade calls
  5. Trigger one or more ghcr.io build image generations & talos node upgrades by modifying resources
  6. Capture these upgrade calls
  7. Assert the build image in these new calls (to be one or more with, always the expected image)

The problem was, between step 4 and 7, an old factory.talos.dev build image could sometimes still be captured due to the nature of controllers asynchronously reconciling resources.

Replace this logic by not clearing the upgrade requests at all, instead, simply ignoring the previous image's preceding captured requests in step 7.

utkuozdemir commented 3 weeks ago

/m