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

Issue 267: Remove runtime drop error message #311

Merged
merged 11 commits into from
Sep 13, 2021
Merged

Conversation

Tristan1900
Copy link
Member

@Tristan1900 Tristan1900 commented Aug 31, 2021

Change log description
Remove runtime drop error message.
Upgrade tonic version to 0.5, prost version to 0.8 as prost version 0.7 is having problem with rustc 1.56.0-nightly (50171c310 2021-09-01) ref.

Purpose of the change
Fix #267 #308 #253

What the code does
ClientFactory is the only place that contains the Runtime and it cannot be cloned, so there is only one place that's holding the runtime now.
Make another struct ClientFacotryAsync that holds Runtime::Handle, which can be cloned and used in async context.

How to verify it
Test should pass

Wenqi Mou added 4 commits August 31, 2021 13:18
Signed-off-by: Wenqi Mou <wenqi.mou@dell.com>
Signed-off-by: Wenqi Mou <wenqi.mou@dell.com>
fix
Signed-off-by: Wenqi Mou <wenqi.mou@dell.com>
Signed-off-by: Wenqi Mou <wenqi.mou@dell.com>
@codecov-commenter
Copy link

codecov-commenter commented Sep 3, 2021

Codecov Report

Merging #311 (798a5eb) into master (3241838) will decrease coverage by 6.75%.
The diff coverage is 68.75%.

@@            Coverage Diff             @@
##           master     #311      +/-   ##
==========================================
- Coverage   75.63%   68.88%   -6.76%     
==========================================
  Files          45       26      -19     
  Lines       11351     6170    -5181     
==========================================
- Hits         8585     4250    -4335     
+ Misses       2766     1920     -846     
Impacted Files Coverage Δ
src/lib.rs 88.23% <ø> (ø)
controller-client/src/lib.rs 59.84% <58.33%> (+5.79%) ⬆️
config/src/lib.rs 94.73% <100.00%> (+0.65%) ⬆️
wire_protocol/src/mock_connection.rs 17.35% <0.00%> (-57.77%) ⬇️
controller-client/src/mock_controller.rs 7.08% <0.00%> (-32.30%) ⬇️
shared/src/lib.rs 48.29% <0.00%> (-31.91%) ⬇️
retry/src/retry_result.rs 64.28% <0.00%> (-21.43%) ⬇️
wire_protocol/src/connection_factory.rs 60.56% <0.00%> (-17.29%) ⬇️
wire_protocol/src/error.rs 15.38% <0.00%> (-15.39%) ⬇️
wire_protocol/src/connection.rs 0.00% <0.00%> (-13.16%) ⬇️
... and 15 more

@Tristan1900 Tristan1900 marked this pull request as ready for review September 3, 2021 09:17
Wenqi Mou added 4 commits September 3, 2021 17:12
Signed-off-by: Wenqi Mou <wenqi.mou@dell.com>
Signed-off-by: Wenqi Mou <wenqi.mou@dell.com>
Signed-off-by: Wenqi Mou <wenqi.mou@dell.com>
Signed-off-by: Wenqi Mou <wenqi.mou@dell.com>
use std::net::Ipv4Addr;

#[test]
#[serial]
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand why these tests can't be run in parallel. This is testing config values.
If it's modifying environment variables, can we split that out into its own test so it don't affect others too much?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes it's because the env var is a shared resource and running unit tests in parallel will have issues.
I have been googling around and cannot find a better way to deal with shared resource like env var in the unit test. Either we run it consecutively or run it using only 1 thread.

@shrids
Copy link
Contributor

shrids commented Sep 8, 2021

Thanks @Tristan1900 . Regarding the build failing for prost version 0.7 on rust rustc 1.56.0-nightly , I have moved the build to use the stable version of rustc in PR: #312

@Tristan1900
Copy link
Member Author

@shrids Thanks Sandeep. I guess we can keep the Tonic upgrade in this PR since we will need to upgrade at some point in the future anyway.

token: Option<String>,
}

impl Interceptor for AuthInterceptor {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you elaborate more on this change? I think it is unrelated to the PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it's the necessary change for upgrading Tonic version. I am following the example here

@@ -13,6 +13,6 @@ deps =
pytest
pytest-timeout
aiounittest
commands = pytest {posargs:tests} --timeout=300 -vvvvv
commands = pytest {posargs:tests} --timeout=300 -vvvvv -s
Copy link
Contributor

Choose a reason for hiding this comment

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

-s disables capturing, capturing simplifies debugging if the tests fail.

Copy link
Member Author

Choose a reason for hiding this comment

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

I see. I found that without -s we couldn't see the log printed out to the stdout, so it's not easy to debug when the tests are stuck at some place.
I can revert it back

Wenqi Mou added 3 commits September 9, 2021 23:35
Signed-off-by: Wenqi Mou <wenqi.mou@dell.com>
Signed-off-by: Wenqi Mou <wenqi.mou@dell.com>
Signed-off-by: Wenqi Mou <wenqi.mou@dell.com>
Copy link
Contributor

@shrids shrids left a comment

Choose a reason for hiding this comment

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

LGTM.

@Tristan1900 Tristan1900 merged commit c6bede7 into master Sep 13, 2021
@Tristan1900 Tristan1900 deleted the drop-runtime branch September 13, 2021 07:00
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.

Panic on shutdown prevents flush
4 participants