Skip to content

Commit

Permalink
fuzz: libc++ clocks don't like nanos. (envoyproxy#4282)
Browse files Browse the repository at this point in the history
This was breaking ClusterFuzz.

Signed-off-by: Harvey Tuch <htuch@google.com>
  • Loading branch information
htuch authored and dnoe committed Aug 28, 2018
1 parent 53f8944 commit fa45bb4
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions test/fuzz/utility.h
Original file line number Diff line number Diff line change
@@ -36,13 +36,9 @@ inline test::fuzz::Headers toHeaders(const Http::HeaderMap& headers) {
inline TestRequestInfo fromRequestInfo(const test::fuzz::RequestInfo& request_info) {
TestRequestInfo test_request_info;
test_request_info.metadata_ = request_info.dynamic_metadata();
#ifdef __APPLE__
// Clocks don't track at nanosecond on OS X.
// libc++ clocks don't track at nanosecond on OS X.
test_request_info.start_time_ =
SystemTime(std::chrono::microseconds(request_info.start_time() / 1000));
#else
test_request_info.start_time_ = SystemTime(std::chrono::nanoseconds(request_info.start_time()));
#endif
if (request_info.has_response_code()) {
test_request_info.response_code_ = request_info.response_code().value();
}

0 comments on commit fa45bb4

Please sign in to comment.