diff --git a/functional/systemd_test.go b/functional/systemd_test.go index 9089cf707..cc884c1bd 100644 --- a/functional/systemd_test.go +++ b/functional/systemd_test.go @@ -119,8 +119,19 @@ func waitForUnitState(mgr unit.UnitManager, name string, want unit.UnitState) er return err } - if reflect.DeepEqual(want, *got) { + if isEqualUnitState(want, *got) { return nil } } } + +// isEqualUnitState checks if both units are the same, +// excluding ActiveEnterTimestamp field of each unit state. +func isEqualUnitState(src, dst unit.UnitState) bool { + return src.LoadState == dst.LoadState && + src.ActiveState == dst.ActiveState && + src.SubState == dst.SubState && + src.MachineID == dst.MachineID && + src.UnitHash == dst.UnitHash && + src.UnitName == dst.UnitName +}