From 72df933919599209ab5b2efdbdb569f7906494e6 Mon Sep 17 00:00:00 2001 From: Robin Tang Date: Mon, 16 Sep 2024 17:51:16 -0700 Subject: [PATCH] Refactor tests. --- clients/snowflake/snowflake_test.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/clients/snowflake/snowflake_test.go b/clients/snowflake/snowflake_test.go index 21ed189de..ab93b739a 100644 --- a/clients/snowflake/snowflake_test.go +++ b/clients/snowflake/snowflake_test.go @@ -126,13 +126,8 @@ func (s *SnowflakeTestSuite) TestExecuteMergeReestablishAuth() { s.stageStore.configMap.AddTableToConfig(s.identifierFor(tableData), types.NewDwhTableConfig(&cols, nil, false, true)) - s.fakeStageStore.ExecReturnsOnCall(0, nil, fmt.Errorf("390114: Authentication token has expired. The user must authenticate again.")) - err := s.stageStore.Merge(tableData) - assert.NoError(s.T(), err, "transient errors like auth errors will be retried") - - // 5 regular ones and then 1 additional one to re-establish auth and another one for dropping the temporary table - baseline := 5 - assert.Equal(s.T(), baseline+2, s.fakeStageStore.ExecCallCount(), "called merge") + assert.NoError(s.T(), s.stageStore.Merge(tableData), "transient errors like auth errors will be retried") + assert.Equal(s.T(), 5, s.fakeStageStore.ExecCallCount(), "called merge") } func (s *SnowflakeTestSuite) TestExecuteMerge() {