Skip to content

Commit

Permalink
changes for fixing timeout tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rajesh-1983 committed May 22, 2024
1 parent d7f08d5 commit af57938
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions tests/unittest/bindEvict/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ func fastAndSlowBinds() error {
// client threads of slow queries
var stop2 int
var badCliErr string
mkClients(1+int(max_conn*1.6), &stop2, 29001111, "badClient", &badCliErr, db)
time.Sleep(3100 * time.Millisecond)
mkClients(1+int(max_conn*1.2), &stop2, 29001111, "badClient", &badCliErr, db)
time.Sleep(5100 * time.Millisecond)
/* if (testutil.RegexCountFile("BIND_THROTTLE", "cal.log") == 0) {
return fmt.Errorf("BIND_THROTTLE was not triggered")
}
Expand Down Expand Up @@ -208,7 +208,7 @@ func TestBindEvict(t *testing.T) {
logger.GetLogger().Log(logger.Debug, "TestBindEvict +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n")
err := fastAndSlowBinds()
if err != nil {
t.Fatalf("main step function returned err %s", err.Error())
t.Errorf("main step function returned err %s", err.Error())
}
if testutil.RegexCountFile("BIND_THROTTLE", "cal.log") == 0 {
t.Fatalf("BIND_THROTTLE was not triggered")
Expand Down
2 changes: 1 addition & 1 deletion tests/unittest/bindThrottle/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func TestBindThrottle(t *testing.T) {
} // */

logger.GetLogger().Log(logger.Debug, "BindThrottle midpt +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n")
err = partialBadLoad(0.8)
err = partialBadLoad(0.7)
if err != nil {
// t.Fatalf("main step function returned err %s", err.Error()) // can be triggered since test only has one sql
}
Expand Down
4 changes: 2 additions & 2 deletions tests/unittest/querybindblocker_timeout/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func cfg() (map[string]string, map[string]string, testutil.WorkerType) {
appcfg["log_file"] = "hera.log"
appcfg["rac_sql_interval"] = "0"
appcfg["enable_query_bind_blocker"] = "true"
appcfg["management_queries_timeout_us"] = "400"
appcfg["management_queries_timeout_us"] = "200"

opscfg := make(map[string]string)
opscfg["opscfg.default.server.max_connections"] = "3"
Expand Down Expand Up @@ -54,7 +54,7 @@ func TestQueryBindBlockerWithTimeout(t *testing.T) {
}
db.SetMaxIdleConns(0)
defer db.Close()
time.Sleep(2 * time.Second)
time.Sleep(3 * time.Second)
out := testutil.RegexCountFile("loading query bind blocker: context deadline exceeded", "hera.log")
if out < 1 {
err = nil
Expand Down

0 comments on commit af57938

Please sign in to comment.