Skip to content

Commit

Permalink
simplify TestGoWrapper test
Browse files Browse the repository at this point in the history
  • Loading branch information
madisonchamberlain committed Jun 18, 2024
1 parent 2ebee9e commit 7eb3f40
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions function_wrapper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package gosnowflake

import (
"context"
"fmt"
"testing"
)

Expand All @@ -27,12 +26,9 @@ func TestGoWrapper(t *testing.T) {

GoroutineWrapper = closeGoWrapperCalledChannel

numrows := 100000
withCancelCtx, cancel := context.WithCancel(context.Background())
// using async mode because I know that will trigger a goroutine to be fired off
ctx := WithAsyncMode(withCancelCtx)
dbt.mustQueryContext(ctx, fmt.Sprintf(selectRandomGenerator, numrows))
cancel()
ctx := WithAsyncMode(context.Background())
rows := dbt.mustQueryContext(ctx, "SELECT 1")
defer rows.Close()

assertTrueF(t, goWrapperCalled, "channel should be closed, indicating our wrapper worked")
})
Expand Down

0 comments on commit 7eb3f40

Please sign in to comment.