Skip to content

Commit f9f9233

Browse files
jszwedkoclaude
andcommitted
fix(integration): force-enable ADP for the Windows runtime
Agent 7.80 added sanitizeDataPlaneConfig, which installs an authoritative data_plane.enabled=false override on any platform other than Linux (macOS was allowlisted later) unless DD_DATA_PLANE_FORCE_ENABLE=true. The Windows integration target runs the Core Agent inside the container (via the ADP entrypoint), so on the 7.80.2 Windows base the Agent streamed data_plane.enabled=false to ADP and ADP exited with "Agent Data Plane is not enabled" -- failing 18/28 Windows integration tests after the Windows base image was bumped off the pre-7.80 7.78.0 pin. Mirror the macOS host-process path (unix_runner::build_core_agent_forced_env) by injecting DD_DATA_PLANE_FORCE_ENABLE=true into the Windows container env whenever DD_DATA_PLANE_ENABLED=true. Linux is unaffected (allowlisted) and an explicit value is preserved. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 87d854b commit f9f9233

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

bin/correctness/panoramic/src/runner.rs

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,18 @@ fn normalize_env_for_runtime(mut env: HashMap<String, String>, runtime: &str) ->
9696
env.entry((*target).to_string()).or_insert(value);
9797
}
9898
}
99+
100+
// As of Agent 7.80, the Core Agent only honors `data_plane.enabled` on Linux (and later
101+
// macOS); on every other platform `sanitizeDataPlaneConfig` installs an authoritative
102+
// `data_plane.enabled=false` override unless `DD_DATA_PLANE_FORCE_ENABLE=true` is set. The
103+
// Core Agent runs inside the Windows target container (started by the ADP entrypoint) and
104+
// reads this flat env var, so without it the Agent streams `data_plane.enabled=false` to ADP
105+
// and ADP exits with "Agent Data Plane is not enabled." Mirror the macOS host-process path
106+
// (see `unix_runner::build_core_agent_forced_env`) and force-enable when ADP is requested.
107+
if env.get("DD_DATA_PLANE_ENABLED").is_some_and(|value| value == "true") {
108+
env.entry("DD_DATA_PLANE_FORCE_ENABLE".to_string())
109+
.or_insert_with(|| "true".to_string());
110+
}
99111
}
100112

101113
env
@@ -1142,4 +1154,46 @@ mod tests {
11421154

11431155
assert!(!normalized.contains_key("DD_DATA_PLANE__ENABLED"));
11441156
}
1157+
1158+
#[test]
1159+
fn windows_runtime_force_enables_adp_when_enabled() {
1160+
let env = HashMap::from([("DD_DATA_PLANE_ENABLED".to_string(), "true".to_string())]);
1161+
1162+
let normalized = normalize_env_for_runtime(env, crate::config::WINDOWS_RUNTIME);
1163+
1164+
// The Core Agent in the Windows target container needs DD_DATA_PLANE_FORCE_ENABLE on
1165+
// non-Linux platforms (Agent 7.80+ `sanitizeDataPlaneConfig`), otherwise it streams
1166+
// data_plane.enabled=false to ADP and ADP exits.
1167+
assert_eq!(normalized.get("DD_DATA_PLANE_FORCE_ENABLE"), Some(&"true".to_string()));
1168+
}
1169+
1170+
#[test]
1171+
fn windows_runtime_does_not_force_enable_adp_when_disabled() {
1172+
let env = HashMap::from([("DD_DATA_PLANE_ENABLED".to_string(), "false".to_string())]);
1173+
1174+
let normalized = normalize_env_for_runtime(env, crate::config::WINDOWS_RUNTIME);
1175+
1176+
assert!(!normalized.contains_key("DD_DATA_PLANE_FORCE_ENABLE"));
1177+
}
1178+
1179+
#[test]
1180+
fn windows_runtime_preserves_explicit_force_enable_value() {
1181+
let env = HashMap::from([
1182+
("DD_DATA_PLANE_ENABLED".to_string(), "true".to_string()),
1183+
("DD_DATA_PLANE_FORCE_ENABLE".to_string(), "false".to_string()),
1184+
]);
1185+
1186+
let normalized = normalize_env_for_runtime(env, crate::config::WINDOWS_RUNTIME);
1187+
1188+
assert_eq!(normalized.get("DD_DATA_PLANE_FORCE_ENABLE"), Some(&"false".to_string()));
1189+
}
1190+
1191+
#[test]
1192+
fn linux_runtime_does_not_force_enable_adp() {
1193+
let env = HashMap::from([("DD_DATA_PLANE_ENABLED".to_string(), "true".to_string())]);
1194+
1195+
let normalized = normalize_env_for_runtime(env, crate::config::LINUX_RUNTIME);
1196+
1197+
assert!(!normalized.contains_key("DD_DATA_PLANE_FORCE_ENABLE"));
1198+
}
11451199
}

0 commit comments

Comments
 (0)