MCPcopy Create free account
hub / github.com/catboost/catboost / TestTimeout

Method TestTimeout

util/network/socket_ut.cpp:54–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54void TSockTest::TestTimeout() {
55 static const int timeout = 1000;
56 i64 startTime = millisec();
57 try {
58 TNetworkAddress addr("localhost", 1313);
59 TSocket s(addr, TDuration::MilliSeconds(timeout));
60 } catch (const yexception&) {
61 }
62 int realTimeout = (int)(millisec() - startTime);
63 if (realTimeout > timeout + 2000) {
64 TString err = TStringBuilder() << "Timeout exceeded: " << realTimeout << " ms (expected " << timeout << " ms)";
65 UNIT_FAIL(err);
66 }
67}
68
69void TSockTest::TestConnectionRefused() {
70 TNetworkAddress addr("localhost", 1313);

Callers

nothing calls this directly

Calls 3

millisecFunction · 0.85
MilliSecondsFunction · 0.85
TStringBuilderClass · 0.50

Tested by

no test coverage detected