fix: remove initGlobalContext writes in tests (#9331)

since we do not close GlobalContext, we do not
need to reinitialize it inside test code
This commit is contained in:
Harshavardhana 2020-04-13 23:21:01 -07:00 committed by GitHub
parent a9d401ac10
commit d079adc167
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -96,30 +96,13 @@ const testConcurrencyLevel = 10
/// (that are executed by other agents) or when customers pass requests through proxies, which may
/// modify the user-agent.
///
/// Content-Length:
///
/// This is ignored from signing because generating a pre-signed URL should not provide a content-length
/// constraint, specifically when vending a S3 pre-signed PUT URL. The corollary to this is that when
/// sending regular requests (non-pre-signed), the signature contains a checksum of the body, which
/// implicitly validates the payload length (since changing the number of bytes would change the checksum)
/// and therefore this header is not valuable in the signature.
///
/// Content-Type:
///
/// Signing this header causes quite a number of problems in browser environments, where browsers
/// like to modify and normalize the content-type header in different ways. There is more information
/// on this in https://github.com/aws/aws-sdk-js/issues/244. Avoiding this field simplifies logic
/// and reduces the possibility of future bugs
///
/// Authorization:
///
/// Is skipped for obvious reasons
///
var ignoredHeaders = map[string]bool{
"Authorization": true,
"Content-Type": true,
"Content-Length": true,
"User-Agent": true,
"Authorization": true,
"User-Agent": true,
}
// Headers to ignore in streaming v4
@ -481,10 +464,6 @@ func resetGlobalIAMSys() {
// Resets all the globals used modified in tests.
// Resetting ensures that the changes made to globals by one test doesn't affect others.
func resetTestGlobals() {
// close any indefinitely running go-routines from previous
// tests.
cancelGlobalContext()
initGlobalContext()
// set globalObjectAPI to `nil`.
resetGlobalObjectAPI()
// Reset config path set.