[grid] Get TZ from parent container when not passed as cap.
Fixes
@@ -313,8 +313,8 @@ private Container createBrowserContainer(int port, Capabilities sessionCapabilit
timeZone.ifPresent(zone -> envVars.put("TZ", zone.getID()));
// Passing env vars set to the child container
Map<String, String> seEnvVars = System.getenv();
- seEnvVars.entrySet()
- .stream().filter(entry -> entry.getKey().startsWith("SE_"))
+ seEnvVars.entrySet().stream()
+ .filter(entry -> entry.getKey().startsWith("SE_"))
.forEach(entry -> envVars.put(entry.getKey(), entry.getValue()));
return envVars;
}
@@ -378,6 +378,10 @@ private TimeZone getTimeZone(Capabilities sessionRequestCapabilities) {
return TimeZone.getTimeZone(tz);
}
}
+ String envTz = System.getenv("TZ");
+ if (Arrays.asList(TimeZone.getAvailableIDs()).contains(envTz)) {
+ return TimeZone.getTimeZone(envTz);
+ }
return null;
}
