rancher / elemental-operator

The Elemental operator is responsible for managing the OS versions and maintaining a machine inventory to assist with edge or baremetal installations.
Apache License 2.0
40 stars 17 forks source link

Remove flaky checksum test #774

Closed anmazzotti closed 2 months ago

anmazzotti commented 2 months ago

Just a little thing bugging me. The "unmanaged reset plan" is a simple sentinel file containing a time.Now() timestamp.

We didn't expose the controller's clock to make it testable, so the checksum test has chances to fail on a slow machine (precision is seconds).

will look like:

handle unmanaged finalizer [It] should update secret with reset plan when unmanaged annotation is true
/elemental-operator/controllers/machineinventory_controller_test.go:644

  [FAILED] Expected
      <string>: "cef759..."
  to equal       |
      <string>: "457f15..."
  In [It] at: /elemental-operator/controllers/machineinventory_controller_test.go:661 @ 06/21/24 13:08:13.001

Simplest solution is to remove this test for this plan, since the same logic is already tested by the similar "should update secret with reset plan" test.