Skip to content

Commit 66d08b1

Browse files
committed
Adjust threshold
1 parent e74405f commit 66d08b1

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

test/test.cc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8205,7 +8205,7 @@ TEST(GlobalTimeoutTest, ContentStream) {
82058205
[&, data](size_t offset, size_t length, DataSink &sink) {
82068206
const size_t DATA_CHUNK_SIZE = 4;
82078207
const auto &d = *data;
8208-
std::this_thread::sleep_for(std::chrono::milliseconds(250));
8208+
std::this_thread::sleep_for(std::chrono::seconds(1));
82098209
sink.write(&d[offset], std::min(length, DATA_CHUNK_SIZE));
82108210
return true;
82118211
},
@@ -8222,7 +8222,7 @@ TEST(GlobalTimeoutTest, ContentStream) {
82228222
"text/plain",
82238223
[i](size_t, DataSink &sink) {
82248224
if (*i < 5) {
8225-
std::this_thread::sleep_for(std::chrono::milliseconds(250));
8225+
std::this_thread::sleep_for(std::chrono::seconds(1));
82268226
sink.write("abcd", 4);
82278227
(*i)++;
82288228
} else {
@@ -8243,7 +8243,7 @@ TEST(GlobalTimeoutTest, ContentStream) {
82438243
"text/plain",
82448244
[i](size_t, DataSink &sink) {
82458245
if (*i < 5) {
8246-
std::this_thread::sleep_for(std::chrono::milliseconds(250));
8246+
std::this_thread::sleep_for(std::chrono::seconds(1));
82478247
sink.os << "abcd";
82488248
(*i)++;
82498249
} else {
@@ -8266,8 +8266,8 @@ TEST(GlobalTimeoutTest, ContentStream) {
82668266

82678267
svr.wait_until_ready();
82688268

8269-
const time_t timeout = 500;
8270-
const time_t threshold = 10;
8269+
const time_t timeout = 2000;
8270+
const time_t threshold = 100;
82718271

82728272
Client cli("localhost", PORT);
82738273
cli.set_global_timeout(std::chrono::milliseconds(timeout));
@@ -8331,7 +8331,7 @@ TEST(GlobalTimeoutTest, ContentStreamSSL) {
83318331
[&, data](size_t offset, size_t length, DataSink &sink) {
83328332
const size_t DATA_CHUNK_SIZE = 4;
83338333
const auto &d = *data;
8334-
std::this_thread::sleep_for(std::chrono::milliseconds(250));
8334+
std::this_thread::sleep_for(std::chrono::seconds(1));
83358335
sink.write(&d[offset], std::min(length, DATA_CHUNK_SIZE));
83368336
return true;
83378337
},
@@ -8348,7 +8348,7 @@ TEST(GlobalTimeoutTest, ContentStreamSSL) {
83488348
"text/plain",
83498349
[i](size_t, DataSink &sink) {
83508350
if (*i < 5) {
8351-
std::this_thread::sleep_for(std::chrono::milliseconds(250));
8351+
std::this_thread::sleep_for(std::chrono::seconds(1));
83528352
sink.write("abcd", 4);
83538353
(*i)++;
83548354
} else {
@@ -8369,7 +8369,7 @@ TEST(GlobalTimeoutTest, ContentStreamSSL) {
83698369
"text/plain",
83708370
[i](size_t, DataSink &sink) {
83718371
if (*i < 5) {
8372-
std::this_thread::sleep_for(std::chrono::milliseconds(250));
8372+
std::this_thread::sleep_for(std::chrono::seconds(1));
83738373
sink.os << "abcd";
83748374
(*i)++;
83758375
} else {
@@ -8392,8 +8392,8 @@ TEST(GlobalTimeoutTest, ContentStreamSSL) {
83928392

83938393
svr.wait_until_ready();
83948394

8395-
const time_t timeout = 500;
8396-
const time_t threshold = 120; // SSL_shutdown takes about 100ms
8395+
const time_t timeout = 2000;
8396+
const time_t threshold = 500; // SSL_shutdown is slow...
83978397

83988398
SSLClient cli("localhost", PORT);
83998399
cli.enable_server_certificate_verification(false);

0 commit comments

Comments
 (0)