Oops, i guess my unit test was flaky in #1068

This commit is contained in:
Benjamin Ullian 2021-05-04 15:41:55 -04:00 committed by Aaron U'Ren
parent e94cba604d
commit fce90b07ec

View File

@ -447,7 +447,13 @@ func buildIPSetRestore(ipset *IPSet) string {
ipSetRestore.WriteString(fmt.Sprintf("flush %s\n", tmpSetName))
}
setsToDestroy := make([]string, 0, len(tmpSets))
for _, tmpSetName := range tmpSets {
setsToDestroy = append(setsToDestroy, tmpSetName)
}
// need to destroy the sets in a predictable order for unit test!
sort.Strings(setsToDestroy)
for _, tmpSetName := range setsToDestroy {
// finally, destroy the tmp sets.
ipSetRestore.WriteString(fmt.Sprintf("destroy %s\n", tmpSetName))
}