Fix race at destruction in StunServerTests and reenable them on tsan
Bug: webrtc:2517 Change-Id: I3d4c65f250fe5048def68cbae45b5637a9ce68a1 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/275483 Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> Cr-Commit-Position: refs/heads/main@{#38087}
This commit is contained in:
parent
664d8a76b4
commit
a01e7275c2
@ -33,8 +33,7 @@ const rtc::SocketAddress client_addr("1.2.3.4", 1234);
|
||||
|
||||
class StunServerTest : public ::testing::Test {
|
||||
public:
|
||||
StunServerTest() : ss_(new rtc::VirtualSocketServer()), network_(ss_.get()) {}
|
||||
virtual void SetUp() {
|
||||
StunServerTest() : ss_(new rtc::VirtualSocketServer()), network_(ss_.get()) {
|
||||
server_.reset(
|
||||
new StunServer(rtc::AsyncUDPSocket::Create(ss_.get(), server_addr)));
|
||||
client_.reset(new rtc::TestClient(
|
||||
@ -42,6 +41,8 @@ class StunServerTest : public ::testing::Test {
|
||||
|
||||
network_.Start();
|
||||
}
|
||||
~StunServerTest() override { network_.Stop(); }
|
||||
|
||||
void Send(const StunMessage& msg) {
|
||||
rtc::ByteBufferWriter buf;
|
||||
msg.Write(&buf);
|
||||
@ -71,10 +72,6 @@ class StunServerTest : public ::testing::Test {
|
||||
std::unique_ptr<rtc::TestClient> client_;
|
||||
};
|
||||
|
||||
// Disable for TSan v2, see
|
||||
// https://code.google.com/p/webrtc/issues/detail?id=2517 for details.
|
||||
#if !defined(THREAD_SANITIZER)
|
||||
|
||||
TEST_F(StunServerTest, TestGood) {
|
||||
// kStunLegacyTransactionIdLength = 16 for legacy RFC 3489 request
|
||||
std::string transaction_id = "0123456789abcdef";
|
||||
@ -135,8 +132,6 @@ TEST_F(StunServerTest, TestNoXorMappedAddr) {
|
||||
delete msg;
|
||||
}
|
||||
|
||||
#endif // if !defined(THREAD_SANITIZER)
|
||||
|
||||
TEST_F(StunServerTest, TestBad) {
|
||||
const char* bad =
|
||||
"this is a completely nonsensical message whose only "
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user