-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SNOW-892592: Fix panic when SF_OCSP_RESPONSE_CACHE_SERVER_ENABLED=false #883
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -533,3 +533,21 @@ func TestInitOCSPCacheFileCreation(t *testing.T) { | |
t.Error(err) | ||
} | ||
} | ||
|
||
func TestCacheServerDisabled(t *testing.T) { | ||
_ = os.Setenv(cacheServerEnabledEnv, "false") | ||
|
||
if _, err := buildSnowflakeConn(context.Background(), Config{ | ||
Account: "testaccount", | ||
User: "testuser", | ||
Password: "testpassword", | ||
Host: "testaccount.us-east-1.snowflakecomputing.com", | ||
}); err != nil { | ||
t.Error(err) | ||
} | ||
|
||
ocspURL := os.Getenv(cacheServerURLEnv) | ||
if ocspURL != "" { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if I understand it. According to the first line in the test, you just set an env variable and now you read another one. I believe this just reads env variable, there is no driver logic. The only reason why this could work is that |
||
t.Fatalf("cache server is disabled. Expected empty url but got %v ", cacheServerURLEnv) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can extract building sf conn outside of the
if
? Or at leastConfig
? Now it's not very readable.