Skip to content

test: Make the creation of a test time system threadsafe#5849

Merged
jmarantz merged 6 commits intoenvoyproxy:masterfrom
jmarantz:threadsafe-time-singleton
Feb 7, 2019
Merged

test: Make the creation of a test time system threadsafe#5849
jmarantz merged 6 commits intoenvoyproxy:masterfrom
jmarantz:threadsafe-time-singleton

Conversation

@jmarantz
Copy link
Contributor

@jmarantz jmarantz commented Feb 5, 2019

Description: I am not aware of a situation where we might race the creation of our thread-system singleton between two threads, but it's not that hard or slow to make that work. So it seems easier to do this proactively than to wait for a flake. Also removes a flaky contention test that failed in CI on this PR.
Risk Level: low
Testing: //test/...
Docs Changes: n/a
Release Notes: n/a

I am not aware of a situation where we might race the creation of our
thread-system singleton between two threads, but it's not that hard or
slow to make that work. So it seems easier to do this proactively than
to wait for a flake.

Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
… and use std::unique_ptr for the functor to create TimeSystems.

Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

LGTM just some nits.

/wait

Signed-off-by: Joshua Marantz <jmarantz@google.com>
@jmarantz
Copy link
Contributor Author

jmarantz commented Feb 6, 2019

/retest

@repokitteh-read-only
Copy link

🔨 rebuilding ci/circleci: mac (failed build)

🐱

Caused by: a #5849 (comment) was created by @jmarantz.

see: more, trace.

Signed-off-by: Joshua Marantz <jmarantz@google.com>
@jmarantz jmarantz merged commit b2218ac into envoyproxy:master Feb 7, 2019
@jmarantz jmarantz deleted the threadsafe-time-singleton branch February 7, 2019 19:52
fredlas pushed a commit to fredlas/envoy that referenced this pull request Mar 5, 2019
…5849)

* Make the creation of a test time system threadsafe.

I am not aware of a situation where we might race the creation of our
thread-system singleton between two threads, but it's not that hard or
slow to make that work. So it seems easier to do this proactively than
to wait for a flake.

Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Fred Douglas <fredlas@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.

2 participants