Skip to content

chore: Fix flaky InstantiatingGrpcChannelProviderTest on Mac #3010

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

Merged
merged 2 commits into from
Jul 3, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ public static void setupClass() {

@BeforeEach
public void setup() throws IOException {
System.setProperty("os.name", "Linux");
computeEngineCredentials = Mockito.mock(ComputeEngineCredentials.class);
}

Expand Down Expand Up @@ -686,6 +685,8 @@ void testLogDirectPathMisconfigNotOnGCE() throws Exception {

@Test
public void canUseDirectPath_happyPath() {
// DirectPath works for a Linux VM
System.setProperty("os.name", "Linux");
EnvironmentProvider envProvider = Mockito.mock(EnvironmentProvider.class);
Mockito.when(
envProvider.getenv(
Expand Down Expand Up @@ -722,6 +723,8 @@ public void canUseDirectPath_directPathEnvVarDisabled() {

@Test
public void canUseDirectPath_directPathEnvVarNotSet_attemptDirectPathIsTrue() {
// DirectPath works for a Linux VM
System.setProperty("os.name", "Linux");
InstantiatingGrpcChannelProvider.Builder builder =
InstantiatingGrpcChannelProvider.newBuilder()
.setAttemptDirectPath(true)
Expand Down
Loading