From 95d46976d4375da37bf34d453598dcc5df3c076c Mon Sep 17 00:00:00 2001 From: Kirill Fomichev Date: Sat, 23 Oct 2021 23:50:47 +0300 Subject: [PATCH] cli: Add NODE_OPTIONS env variable with DNS fix (#915) --- .travis.yml | 2 +- cli/src/lib.rs | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e8842039..cf1a4d4e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ rust: cache: cargo env: global: - - NODE_VERSION="14.7.0" + - NODE_VERSION="17.0.1" - SOLANA_CLI_VERSION="1.7.11" git: submodules: true diff --git a/cli/src/lib.rs b/cli/src/lib.rs index 963e9770..fb4d9a5e 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -1477,6 +1477,16 @@ fn test( let url = cluster_url(cfg); + let node_options = format!( + "{} --dns-result-order=ipv4first", + match std::env::var_os("NODE_OPTIONS") { + Some(value) => value + .into_string() + .map_err(std::env::VarError::NotUnicode)?, + None => "".to_owned(), + } + ); + // Setup log reader. let log_streams = stream_logs(cfg, &url); @@ -1497,6 +1507,7 @@ fn test( .args(args) .env("ANCHOR_PROVIDER_URL", url) .env("ANCHOR_WALLET", cfg.provider.wallet.to_string()) + .env("NODE_OPTIONS", node_options) .stdout(Stdio::inherit()) .stderr(Stdio::inherit()) .output()