Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,15 @@ func (a AuroraTestUtility) TriggerFailover(initialWriter string, clusterId strin
if RDS_MULTI_AZ_CLUSTER == deployment {
slog.Debug("TriggerFailover() - RDS_MULTI_AZ_CLUSTER deployment detected. Simulating temporary failure")
a.SimulateTemporaryFailure()
return nil
} else {
slog.Debug(fmt.Sprintf("TriggerFailover() - dbengine deployment %v detected. FailoverClusterAndWaitTillWriterChanged", deployment))
return a.FailoverClusterAndWaitTillWriterChanged(initialWriter, clusterId, targetWriterId)
err = a.FailoverClusterAndWaitTillWriterChanged(initialWriter, clusterId, targetWriterId)
if err != nil {
return err
}
}

return VerifyClusterStatus()
}

func (a AuroraTestUtility) SimulateTemporaryFailure() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ func GetPropsForProxyWithConnectTimeout(env *TestEnvironment, host, plugins stri
}

func AddDriverConnectTimeoutToProps(env *TestEnvironment, props map[string]string, timeout int) map[string]string {
timeoutStr := strconv.Itoa(timeout - 1)
timeoutStr := strconv.Itoa(timeout + 1)
var timeoutParam string
switch env.Info().Request.Engine {
case PG:
timeoutParam = "connect_timeout"
case MYSQL:
timeoutParam = "readTimeout"
timeoutParam = "timeout"
timeoutStr += "s"
}
props[timeoutParam] = timeoutStr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var failoverConfigs = []failoverTestConfig{
name: "Failover",
pluginType: FailoverPluginMode,
setupFn: func(t *testing.T, env *test_utils.TestEnvironment, host string) map[string]string {
return test_utils.GetPropsForProxy(env, host, "failover", 5)
return test_utils.GetPropsForProxy(env, host, "failover,", 5)
},
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -748,10 +748,10 @@ func TestReadWriteSplitting_FailoverReaderToWriter(t *testing.T) {

// Expect failover to writer for reads
_, err = executeInstanceQuery(setup.env, conn, context.TODO(), 60)
assert.Error(t, err)
require.Error(t, err)
awsWrapperError, ok := err.(*error_util.AwsWrapperError)
assert.True(t, ok)
assert.True(t, awsWrapperError.IsFailoverErrorType())
require.True(t, ok)
require.True(t, awsWrapperError.IsFailoverErrorType())

instanceId, err := executeInstanceQuery(setup.env, conn, context.TODO(), 60)
assert.NoError(t, err)
Expand Down
1 change: 0 additions & 1 deletion awssql/utils/method_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ var NETWORK_BOUND_METHODS = []string{
CONN_EXEC_CONTEXT,
CONN_PING,
CONN_IS_VALID,
CONN_RESET_SESSION,
STMT_EXEC,
STMT_EXEC_CONTEXT,
STMT_QUERY,
Expand Down
Loading