Re-enabling parallel license tests for L1 and ModMock.

[ Merge of http://go/wvgerrit/102108 ]

Several tests that make parallel license requests were disabled due
to a flaky server failure unrelated to CDM code.  Most of these tests
are now re-enabled to ensure the multi-threaded license requests is
functional on V16.

These tests remains disabled for L3 due to continued flakiness.

Added a lock around the initialization of the SSL library to prevent
issues with license requests getting garbled.

Bug: 137619348
Test: Linux and Android unit tests
Change-Id: Idffaa6039b2bde12613bb5033af32d1af6704c76
This commit is contained in:
Alex Dale
2020-07-07 18:52:43 -07:00
parent 1cd67ca8f9
commit cf6cf5f4e8
2 changed files with 62 additions and 17 deletions

View File

@@ -87,8 +87,8 @@ void UrlRequest::Reconnect() {
if (socket_.Connect(kConnectTimeoutMs)) {
is_connected_ = true;
} else {
LOGE("failed to connect to %s, port=%d", socket_.domain_name().c_str(),
socket_.port());
LOGE("Failed to connect: url = %s, port = %d, attempt = %u",
socket_.domain_name().c_str(), socket_.port(), i);
}
}
}
@@ -148,7 +148,7 @@ bool UrlRequest::PostRequestWithPath(const std::string& path,
// buffer to store length of data as a string
char data_size_buffer[32] = {0};
snprintf(data_size_buffer, sizeof(data_size_buffer), "%zd", data.size());
snprintf(data_size_buffer, sizeof(data_size_buffer), "%zu", data.size());
request.append("Content-Length: ");
request.append(data_size_buffer); // appends size of data
@@ -158,7 +158,8 @@ bool UrlRequest::PostRequestWithPath(const std::string& path,
request.append(data);
int ret = socket_.Write(request.c_str(), request.size(), kWriteTimeoutMs);
const int ret =
socket_.Write(request.c_str(), request.size(), kWriteTimeoutMs);
LOGV("HTTP request: (%d): %s", request.size(), b2a_hex(request).c_str());
return ret != -1;
}