From 49fb2bc825fb8eee0e615c05239c8dae08a9958b Mon Sep 17 00:00:00 2001 From: Silvestre Zabala Date: Tue, 27 Aug 2024 13:16:42 +0200 Subject: [PATCH] fix(test): Fix `scalingengine_sqldb_test.go` # Issue The ScalingEngineSqldb tests had become flaky # Fix A well-meaning but harmfull test cleanup function was removed. --- src/autoscaler/db/sqldb/scalingengine_sqldb_test.go | 2 -- src/autoscaler/db/sqldb/sqldb_suite_test.go | 5 ----- 2 files changed, 7 deletions(-) diff --git a/src/autoscaler/db/sqldb/scalingengine_sqldb_test.go b/src/autoscaler/db/sqldb/scalingengine_sqldb_test.go index ccf880ecb3..f3c5b41546 100644 --- a/src/autoscaler/db/sqldb/scalingengine_sqldb_test.go +++ b/src/autoscaler/db/sqldb/scalingengine_sqldb_test.go @@ -73,12 +73,10 @@ var _ = Describe("ScalingEngineSqldb", func() { cleanupForApp(appId) cleanupForApp(appId2) cleanupForApp(appId3) - cleanUpCooldownTable() DeferCleanup(func() { cleanupForApp(appId) cleanupForApp(appId2) cleanupForApp(appId3) - cleanUpCooldownTable() }) }) diff --git a/src/autoscaler/db/sqldb/sqldb_suite_test.go b/src/autoscaler/db/sqldb/sqldb_suite_test.go index 6043353c9e..8a5c43f258 100644 --- a/src/autoscaler/db/sqldb/sqldb_suite_test.go +++ b/src/autoscaler/db/sqldb/sqldb_suite_test.go @@ -210,11 +210,6 @@ func removeCooldownForApp(appId string) { FailOnError("can not remove scalingcooldown for app", err) } -func cleanUpCooldownTable() { - _, err := dbHelper.Exec("DELETE from scalingcooldown") - FailOnError("can not clean table scalingcooldown", err) -} - func removeActiveScheduleForApp(appId string) { query := dbHelper.Rebind("DELETE from activeschedule where appId = ?") _, err := dbHelper.Exec(query, appId)