Commit cf150a3d authored by Ken Rockot's avatar Ken Rockot Committed by Commit Bot

mojo_unittests: Decrease cost of MessageTest.ExtendMessagePayloadLarge

This test is timing out on Windows debug, where even on very fast
devices it can take 35+ seconds to run.

The runtime grows linearly with the size of the test message used, so
this cuts that size to one tenth (512 kB instead of 5 MB).

TBR=jcivelli@chromium.org

Bug: 819046
Change-Id: Ib4598981856566dc8ae54de1060840b52e30b959
Reviewed-on: https://chromium-review.googlesource.com/954045Reviewed-by: default avatarKen Rockot <rockot@chromium.org>
Commit-Queue: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541704}
parent 07f90632
......@@ -705,11 +705,11 @@ TEST_F(MessageTest, ExtendMessagePayloadLarge) {
ASSERT_GE(buffer_size, static_cast<uint32_t>(kTestMessageHeader.size()));
memcpy(buffer, kTestMessageHeader.data(), kTestMessageHeader.size());
// 5 MB should be well beyond any reasonable default buffer size for the
// 512 kB should be well beyond any reasonable default buffer size for the
// system implementation to choose, meaning that this test should guarantee
// several reallocations of the serialized message buffer as we
// progressively extend the payload to this size.
constexpr size_t kTestMessagePayloadSize = 5 * 1024 * 1024;
constexpr size_t kTestMessagePayloadSize = 512 * 1024;
std::vector<uint8_t> test_payload(kTestMessagePayloadSize);
base::RandBytes(test_payload.data(), kTestMessagePayloadSize);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment