Skip to content

quiche: implement QuicEpollClock#6745

Merged
alyssawilk merged 15 commits intoenvoyproxy:masterfrom
danzh2010:epoll
Apr 30, 2019
Merged

quiche: implement QuicEpollClock#6745
alyssawilk merged 15 commits intoenvoyproxy:masterfrom
danzh2010:epoll

Conversation

@danzh2010
Copy link
Copy Markdown
Contributor

Define QuicEpollImpl as alias of SimpleEpollServer. Use that to define QuicEpollClock which is the clock used in quiche e2e test.

Risk Level: low, test only
Testing: Added tests of QuicEpollServer in quic_platform_test.cc.
Part of #2557

Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
Signed-off-by: Dan Zhang <danzh@google.com>
@danzh2010
Copy link
Copy Markdown
Contributor Author

/assign @wu-bin

Signed-off-by: Dan Zhang <danzh@google.com>
deps = [":quic_platform"],
)

envoy_cc_test_library(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be a envoy_cc_library?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. changed.

envoy_cc_test(
name = "quic_platform_test",
srcs = ["quic_platform_test.cc"],
copts = ["-Wno-unused-parameter"],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Add a quiche_copt for it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be only place need copts in this BUILD file. If it turns out that we need it in more places, I would prefer to define quiche_copt in a centralize place instead of defining it repeatedly in each BUILD file.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM.


envoy_cc_test_library(
name = "quic_platform_epoll_clock_lib",
srcs = [
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Fold "srcs" and "hdrs" to single line?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


namespace quic {

bool quic_monotonic_epoll_clock = false;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this variable is not used, remove it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

#include "quiche/quic/platform/api/quic_clock.h"

namespace quic {
extern bool quic_monotonic_epoll_clock;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

extern bool quic_monotonic_epoll_clock;

// Clock to efficiently retrieve an approximately accurate time from an
// net::EpollServer.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: epoll_server::SimpleEpollServer

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

EXPECT_EQ(1000005, (clock.Now() - QuicTime::Zero()).ToMicroseconds());
}

TEST_F(QuicPlatformTest, MonotonicityWithRealEpollClock) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The internal version of this test uses a real EpollServer, is it possible to do the same here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, switched to SimpleEpollServer

Signed-off-by: Dan Zhang <danzh@google.com>
Copy link
Copy Markdown
Contributor

@wu-bin wu-bin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, thanks Dan!

envoy_cc_test(
name = "quic_platform_test",
srcs = ["quic_platform_test.cc"],
copts = ["-Wno-unused-parameter"],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM.

@danzh2010
Copy link
Copy Markdown
Contributor Author

/assign @alyssawilk

@alyssawilk alyssawilk merged commit f0aedf0 into envoyproxy:master Apr 30, 2019
mpuncel added a commit to mpuncel/envoy that referenced this pull request May 1, 2019
* master: (35 commits)
  Revert "api: Add total_issued_requests to Upstream Locality and Endpoint Stats. (envoyproxy#6692)" (envoyproxy#6761)
  Add test for the SocketOptionFactory::buildLiteralOptions() method. (envoyproxy#6724)
  Add test of parsing weighted_cluster route configuration to improve test coverage. (envoyproxy#6711)
  test: reducing H2 test permutations, increasing coverage time (envoyproxy#6753)
  Support gRPC-JSON translate without the google.api.http option. (envoyproxy#6731)
  quiche: implement QuicEpollClock (envoyproxy#6745)
  http: rc details for main Envoy workflow (envoyproxy#6560)
  quiche: implement QuicSystemEventLoopImpl (envoyproxy#6723)
  http: tracking 100s from upstream in stats (envoyproxy#6746)
  coverage: run without deprecated  option (envoyproxy#6752)
  quiche: Implement spdy_test_helpers_impl. (envoyproxy#6741)
  [test] convert listener test stubs to v2 API (envoyproxy#6735)
  api: Add total_issued_requests to Upstream Locality and Endpoint Stats. (envoyproxy#6692)
  quiche: Implement http2_reconstruct_object_impl.h. (envoyproxy#6717)
  build: patch protobuf for UBSAN issue. (envoyproxy#6721)
  router: scoped rds (2a): scoped routing configuration protos (envoyproxy#6675)
  tap: use move semantics for submitTrace (envoyproxy#6709)
  quiche: add epoll_server for testing (envoyproxy#6650)
  Increase timeout of the coverage test run to 3000 seconds as it is now bumping in the current 2000s limit causing coverage run to abort sometimes. (envoyproxy#6722)
  quiche: Update tarball to commit 43a1c0f10f2855c3cd142f500e8d19ac6d6f5a8c (envoyproxy#6718)
  ...

Signed-off-by: Michael Puncel <mpuncel@squareup.com>
jeffpiazza-google pushed a commit to jeffpiazza-google/envoy that referenced this pull request May 3, 2019
Define QuicEpollImpl as alias of SimpleEpollServer. Use that to define QuicEpollClock which is the clock used in quiche e2e test.

Risk Level: low, test only
Testing: Added tests of QuicEpollServer in quic_platform_test.cc.
Part of envoyproxy#2557

Signed-off-by: Dan Zhang <danzh@google.com>

Signed-off-by: Jeff Piazza <jeffpiazza@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants