You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ma...@apache.org on 2018/08/31 02:45:15 UTC

[trafficserver] 03/03: Acquire mutex lock before handleEvent() call in unit test of QUICStream

This is an automated email from the ASF dual-hosted git repository.

masaori pushed a commit to branch quic-latest
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 4094f6b7bbe2fc8242b879444aa2773fb9f6eed4
Author: Masaori Koshiba <ma...@apache.org>
AuthorDate: Fri Aug 31 11:44:07 2018 +0900

    Acquire mutex lock before handleEvent() call in unit test of QUICStream
---
 iocore/net/quic/test/test_QUICStream.cc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/iocore/net/quic/test/test_QUICStream.cc b/iocore/net/quic/test/test_QUICStream.cc
index 535b89b..b88abd3 100644
--- a/iocore/net/quic/test/test_QUICStream.cc
+++ b/iocore/net/quic/test/test_QUICStream.cc
@@ -188,6 +188,8 @@ TEST_CASE("QUICStream", "[quic]")
     IOBufferReader *write_buffer_reader = write_buffer->alloc_reader();
 
     std::unique_ptr<QUICStream> stream(new QUICStream(new MockQUICRTTProvider(), new MockQUICConnectionInfoProvider(), stream_id));
+    SCOPED_MUTEX_LOCK(lock, stream->mutex, this_ethread());
+
     stream->init_flow_control_params(4096, 4096);
     MockContinuation mock_cont(stream->mutex);
     stream->do_io_read(nullptr, INT64_MAX, read_buffer);
@@ -197,6 +199,7 @@ TEST_CASE("QUICStream", "[quic]")
 
     const char data[1024] = {0};
     QUICFrameUPtr frame   = QUICFrameFactory::create_null_frame();
+
     write_buffer->write(data, 1024);
     stream->handleEvent(VC_EVENT_WRITE_READY, nullptr);
     CHECK(stream->will_generate_frame(level) == true);