diff --git a/agent/runner/actions/mysql_explain_action_test.go b/agent/runner/actions/mysql_explain_action_test.go index eab58cece9..20f56ca82e 100644 --- a/agent/runner/actions/mysql_explain_action_test.go +++ b/agent/runner/actions/mysql_explain_action_test.go @@ -174,14 +174,8 @@ func TestMySQLExplain(t *testing.T) { OutputFormat: agentpb.MysqlExplainOutputFormat_MYSQL_EXPLAIN_OUTPUT_FORMAT_DEFAULT, } a, err := NewMySQLExplainAction("", time.Second, params) - require.NoError(t, err) - - ctx, cancel := context.WithTimeout(context.Background(), a.Timeout()) - defer cancel() - - _, err = a.Run(ctx) - require.Error(t, err) assert.Regexp(t, `Query to EXPLAIN is empty`, err.Error()) + assert.Nil(t, a) }) t.Run("DML Query Insert", func(t *testing.T) { @@ -216,13 +210,8 @@ func TestMySQLExplain(t *testing.T) { OutputFormat: agentpb.MysqlExplainOutputFormat_MYSQL_EXPLAIN_OUTPUT_FORMAT_DEFAULT, } a, err := NewMySQLExplainAction("", time.Second, params) - require.NoError(t, err) - - ctx, cancel := context.WithTimeout(context.Background(), a.Timeout()) - defer cancel() - - _, err = a.Run(ctx) - require.Error(t, err, "EXPLAIN failed because the query was too long and trimmed. Set max-query-length to a larger value.") + assert.Error(t, err, "EXPLAIN failed because the query was too long and trimmed. Set max-query-length to a larger value.") + assert.Nil(t, a) }) t.Run("LittleBobbyTables", func(t *testing.T) { diff --git a/agent/runner/actions/postgresql_query_select_action_test.go b/agent/runner/actions/postgresql_query_select_action_test.go index 4928677bef..c62f559c82 100644 --- a/agent/runner/actions/postgresql_query_select_action_test.go +++ b/agent/runner/actions/postgresql_query_select_action_test.go @@ -103,18 +103,7 @@ func TestPostgreSQLQuerySelect(t *testing.T) { Query: "* FROM city; DROP TABLE city CASCADE; --", } a, err := NewPostgreSQLQuerySelectAction("", 0, params, os.TempDir()) - require.NoError(t, err) - - ctx, cancel := context.WithTimeout(context.Background(), time.Second) - defer cancel() - - b, err := a.Run(ctx) assert.EqualError(t, err, "query contains ';'") - assert.Nil(t, b) - - var count int - err = db.QueryRow("SELECT COUNT(*) FROM city").Scan(&count) - require.NoError(t, err) - assert.Equal(t, 4079, count) + assert.Nil(t, a) }) }