Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloned QuicTestServer #1989

Merged
merged 65 commits into from
Jan 20, 2022
Merged

Cloned QuicTestServer #1989

merged 65 commits into from
Jan 20, 2022

Conversation

carloseltuerto
Copy link
Contributor

@carloseltuerto carloseltuerto commented Dec 27, 2021

This PR was authored by colibie at 95%
Description: copy of pr/1870 authored by colibie where missing bits were added
Risk Level: N/A
Testing: test added
Docs Changes: N/A
Release Notes: N/A
Signed-off-by: Charles Le Borgne [email protected]

Signed-off-by: Chidera Olibie <[email protected]>
Signed-off-by: Chidera Olibie <[email protected]>
Signed-off-by: Chidera Olibie <[email protected]>
Signed-off-by: Chidera Olibie <[email protected]>
Signed-off-by: Chidera Olibie <[email protected]>
Signed-off-by: Chidera Olibie <[email protected]>
Signed-off-by: Chidera Olibie <[email protected]>
Signed-off-by: Chidera Olibie <[email protected]>
Signed-off-by: Chidera Olibie <[email protected]>
Signed-off-by: Chidera Olibie <[email protected]>
Signed-off-by: Chidera Olibie <[email protected]>
Signed-off-by: Chidera Olibie <[email protected]>
Signed-off-by: Chidera Olibie <[email protected]>
Signed-off-by: Chidera Olibie <[email protected]>
Signed-off-by: Chidera Olibie <[email protected]>
Signed-off-by: Charles Le Borgne <[email protected]>
Signed-off-by: Charles Le Borgne <[email protected]>
Signed-off-by: Charles Le Borgne <[email protected]>
Signed-off-by: Charles Le Borgne <[email protected]>
Signed-off-by: Charles Le Borgne <[email protected]>
Signed-off-by: Charles Le Borgne <[email protected]>
Signed-off-by: Charles Le Borgne <[email protected]>
Signed-off-by: Charles Le Borgne <[email protected]>
@lfpino
Copy link
Contributor

lfpino commented Jan 13, 2022

If you're seeing port binding issues on Mac this is probably due to the fact that it's running on a sandbox without network by default. Just do what other tests do:

exec_properties = {
and it should work

Signed-off-by: Charles Le Borgne <[email protected]>
Signed-off-by: Charles Le Borgne <[email protected]>
Signed-off-by: Charles Le Borgne <[email protected]>
Copy link
Contributor

@colibie colibie left a comment

Choose a reason for hiding this comment

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

Awesome. So happy this finally works.

colibie
colibie previously approved these changes Jan 14, 2022
@carloseltuerto carloseltuerto requested review from alyssawilk and RyanTheOptimist and removed request for goaway and buildbreaker January 15, 2022 12:01
Copy link
Contributor

@RyanTheOptimist RyanTheOptimist left a comment

Choose a reason for hiding this comment

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

Nice! This looks great. A few comments, mostly around comments.

// end pre-setup

upstream_config_.upstream_protocol_ = Http::CodecType::HTTP3;
upstream_config_.udp_fake_upstream_ = FakeUpstreamConfig::UdpConfig();
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Could these both be done in the constructor since they don't seem to change per start()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I moved line 49, but kept line 48: the upstream_protocol will become a parameter soon. the goal is to also use this server to H2 also. Some renaming will take place later.

extern "C" { // functions
#endif

void start_server();
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Should we have brief comments for these methods?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

ON_CALL(factory_context_, scope()).WillByDefault(testing::ReturnRef(stats_store_));
}

void QuicTestServer::startQuicTestServer() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this perhaps ASSERT(!upstream_)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

ENVOY_LOG_MISC(debug, "Upstream now listening on {}", upstream_->localAddress()->asString());
}

void QuicTestServer::shutdownQuicTestServer() { upstream_.reset(); }
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this ASSERT(upstream_)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

public:
QuicTestServer();

void startQuicTestServer();
Copy link
Contributor

Choose a reason for hiding this comment

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

Brief comments here would be nice.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

private static final AtomicBoolean sServerRunning = new AtomicBoolean();

/*
* Starts the server.
Copy link
Contributor

Choose a reason for hiding this comment

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

Comment what happens if the server is already running?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done


public static final String getServerCertKey() { return KEY_USED; }

public static long createMockCertVerifier() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of curiosity, what does the return value represent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IDK - removed :-)

Signed-off-by: Charles Le Borgne <[email protected]>
Signed-off-by: Charles Le Borgne <[email protected]>
Signed-off-by: Charles Le Borgne <[email protected]>
Copy link
Contributor

@RyanTheOptimist RyanTheOptimist left a comment

Choose a reason for hiding this comment

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

Looks great to me! Thanks for doing this.

@alyssawilk alyssawilk merged commit 100a566 into envoyproxy:main Jan 20, 2022
jpsim added a commit to jpsim/envoy-mobile that referenced this pull request Feb 3, 2022
* origin/main: (21 commits)
  owners: adding charles (envoyproxy#2038)
  [OWNERS] Update Envoy Mobile owners (envoyproxy#2031)
  [deps] Update rules_android to a stable release URL (envoyproxy#2032)
  [json] Remove com_github_nlohmann_json override & patch (envoyproxy#2030)
  Enable the "received byte count" feature. (envoyproxy#2004)
  Run Kotlin macOS tests without EngFlow (envoyproxy#2018)
  final_intel: adding response flags (envoyproxy#2009)
  fix (envoyproxy#2025)
  stream intel: update kotlin public interface to align with swift (envoyproxy#2013)
  tls: update bundled root certificates (envoyproxy#2016)
  tooling: first pass at oncall tooling (envoyproxy#2014)
  test: Solve CI flakiness for test/java/org/chromium/net/urlconnection:urlconnection_test  (envoyproxy#2007)
  envoy: 519774f742 (envoyproxy#2015)
  Default timestamp to -1 for envoy_final_stream_intel (envoyproxy#2006)
  QuicTestServer (envoyproxy#1989)
  bump boringssl to Envoy's version (envoyproxy#1999)
  docs: addding release notes (envoyproxy#2001)
  release: cutting the 0.4.5 release (envoyproxy#2000)
  Revert "bazel: change bazelisk for M1 support (envoyproxy#1966)" (envoyproxy#1998)
  Decompress even when `no-transform` is specified (envoyproxy#1995)
  ...

Signed-off-by: JP Simard <[email protected]>
@carloseltuerto carloseltuerto deleted the cronvoy052 branch February 15, 2022 19:25
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.

6 participants