DeviceStatusCollectorTest.ActivityTimesKeptUntilSubmittedSuccessfully Fails on Mojo bot |
|||||
Issue description
Hi ljusten@ and isandrk@
I've seen that you either have done a fair bit of work on this test in the past, or have recently committed to the test.
On the Mojo Chromium OS FYI bot I am seeing a failure in this test with the following output:
../../chrome/browser/chromeos/policy/device_status_collector_browsertest.cc:784: Failure
Expected: first_status.SerializeAsString()
Which is: "\n\0\x12\0*\v61.0.3158.02\x14\n\xE\b\x80\xB8\x94\xF3\xD3+\x10\x80\xF0\xAD\x9C\xD4+\x10\xE0\xD4\x3p\x80\xE0\xAC\xE8u\x98\x1K"
To be equal to: device_status_.SerializeAsString()
Which is: "\n\a0.0.0.0\x12\0*\v61.0.3158.02\x14\n\xE\b\x80\xB8\x94\xF3\xD3+\x10\x80\xF0\xAD\x9C\xD4+\x10\xE0\xD4\x3`\0p\x80\xE0\xAC\xE8ux\x80\xC0\xEE\xF7_\x98\x1K"
With diff:
@@ -1,3 +1,3 @@
-\0\x12\0*\v61.0.3158.02\x14
-\xE\b\x80\xB8\x94\xF3\xD3+\x10\x80\xF0\xAD\x9C\xD4+\x10\xE0\xD4\x3p\x80\xE0\xAC\xE8u\x98\x1K
+\a0.0.0.0\x12\0*\v61.0.3158.02\x14
+\xE\b\x80\xB8\x94\xF3\xD3+\x10\x80\xF0\xAD\x9C\xD4+\x10\xE0\xD4\x3`\0p\x80\xE0\xAC\xE8ux\x80\xC0\xEE\xF7_\x98\x1K
Any guidance would be appreciated.
This shows up in this run: https://build.chromium.org/p/chromium.fyi/builders/Mojo%20ChromiumOS/builds/19946
The failure is occurring in mash_browser_tests
,
Jul 17 2017
first_status:
os_version: ""
firmware_version: ""
browser_version: "61.0.3158.0"
active_period {
time_period {
start_timestamp: 1499990400000
end_timestamp: 1500076800000
}
active_duration: 60000
}
system_ram_total: 31625785344
sound_volume: 75
device_status_:
os_version: "0.0.0.0"
firmware_version: ""
browser_version: "61.0.3158.0"
active_period {
time_period {
start_timestamp: 1499990400000
end_timestamp: 1500076800000
}
active_duration: 60000
}
->cpu_utilization_pct: 0
system_ram_total: 31625785344
->system_ram_free: 25752739840
sound_volume: 75
Looks like resource usage collection happened in between (runs on a timer every 2 minutes). The solution is to compare activity times only. CL is up: https://chromium-review.googlesource.com/c/573901/.
,
Jul 17 2017
For the record, if you ever want to debug protos from failed tests, it's a bit tricky to deal with 0 characters in these strings. This works: char chars[] = "\n\0\x12\0*\v61.0.3158.02\x14\n\xE\b\x80\xB8\x94\xF3\xD3+\x10\x80\xF0\xAD\x9C\xD4+\x10\xE0\xD4\x3p\x80\xE0\xAC\xE8u\x98\x1K"; first_status.ParseFromArray(chars, arraysize(chars) - 1); Note the -1 to remove 0 terminator. To print out the proto in a human-readable format, it has to be compiled as full proto, not light: - In third_party/protobuf/BUILD.gn, move all sources from protobuf_full to protobuf_lite_sources - Remove option optimize_for = LITE_RUNTIME; from proto files you want to print - LOG(INFO) << first_status.DebugString();
,
Jul 17 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/9d23034c583ce7219b4d2c9a5ef9bb6b8205a63e commit 9d23034c583ce7219b4d2c9a5ef9bb6b8205a63e Author: Lutz Justen <ljusten@chromium.org> Date: Mon Jul 17 09:37:29 2017 Fix flakyness in DeviceStatusCollectorTest DeviceStatusCollector collects resource usage stats every 2 minutes. The ActivityTimesKeptUntilSubmittedSuccessfully test compared two full instances of DeviceStatusReportRequest. In one run of the test, the test failed because the resource usage collection happened right in between. This CL compares activity times only (aka what the test is interested in) and removes the full status comparison. Also fixes an uninteresting mock function call and moves some functions from public to protected. BUG= chromium:743061 TEST=out/Release/browser_tests --gtest_filter=DeviceStatusCollectorTest.* Change-Id: I39d65260794326cae90d57ec583ff28e2d9a9092 Reviewed-on: https://chromium-review.googlesource.com/573901 Reviewed-by: Drew Wilson <atwilson@chromium.org> Commit-Queue: Lutz Justen <ljusten@chromium.org> Cr-Commit-Position: refs/heads/master@{#487034} [modify] https://crrev.com/9d23034c583ce7219b4d2c9a5ef9bb6b8205a63e/chrome/browser/chromeos/policy/device_status_collector_browsertest.cc
,
Jul 17 2017
,
Jul 17 2017
Thanks for the proto debugging steps! I was completely lost there. Also thanks for the fix!
,
Feb 26 2018
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by ljusten@chromium.org
, Jul 14 2017