Skip to content

✅ allow running e2e tests offline#4336

Merged
BenoitZugmeyer merged 2 commits intomainfrom
benoit/e2e-offline-support
Mar 16, 2026
Merged

✅ allow running e2e tests offline#4336
BenoitZugmeyer merged 2 commits intomainfrom
benoit/e2e-offline-support

Conversation

@BenoitZugmeyer
Copy link
Copy Markdown
Member

@BenoitZugmeyer BenoitZugmeyer commented Mar 13, 2026

Motivation

Running E2E tests in an offline environment (e.g. on an airplane or without network access) would fail immediately — once because getIp() crashed when no network interface was found, and again because the intake server would reject connections when trying to forward requests to Datadog.

Changes

  • Fall back to 127.0.0.1 in getIp() when no external IPv4 interface is available, instead of throwing
  • Gracefully handle forwarding errors in the intake server by logging and resolving instead of rejecting

Test instructions

Run the E2E test suite while offline (or with the network interface disabled) and verify the tests start up correctly instead of crashing at initialization.

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated documentation and/or relevant AGENTS.md file

When no network interface is available (e.g. offline dev environment),
`getIp()` would throw due to the non-null assertion. Fall back to
`127.0.0.1` instead.

Similarly, forwarding intake requests to Datadog may fail when offline;
log the error and resolve gracefully so the test suite can continue.
@BenoitZugmeyer BenoitZugmeyer marked this pull request as ready for review March 13, 2026 16:58
@BenoitZugmeyer BenoitZugmeyer requested a review from a team as a code owner March 13, 2026 16:58
@cit-pr-commenter-54b7da
Copy link
Copy Markdown

cit-pr-commenter-54b7da bot commented Mar 13, 2026

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 175.00 KiB 175.00 KiB 0 B 0.00%
Rum Profiler 6.16 KiB 6.16 KiB 0 B 0.00%
Rum Recorder 27.46 KiB 27.46 KiB 0 B 0.00%
Logs 56.80 KiB 56.80 KiB 0 B 0.00%
Flagging 944 B 944 B 0 B 0.00%
Rum Slim 130.64 KiB 130.64 KiB 0 B 0.00%
Worker 23.63 KiB 23.63 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base CPU Time (ms) Local CPU Time (ms) 𝚫%
RUM - add global context 0.0046 0.0042 -8.70%
RUM - add action 0.0127 0.0137 +7.87%
RUM - add error 0.0135 0.0133 -1.48%
RUM - add timing 0.0025 0.0028 +12.00%
RUM - start view 0.0122 0.0155 +27.05%
RUM - start/stop session replay recording 0.0007 0.0008 +14.29%
Logs - log message 0.0144 0.0159 +10.42%
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
RUM - add global context 27.37 KiB 25.81 KiB -1.57 KiB
RUM - add action 53.07 KiB 49.94 KiB -3.13 KiB
RUM - add timing 25.97 KiB 27.10 KiB +1.13 KiB
RUM - add error 55.69 KiB 55.71 KiB +20 B
RUM - start/stop session replay recording 25.52 KiB 26.19 KiB +683 B
RUM - start view 462.52 KiB 469.77 KiB +7.25 KiB
Logs - log message 44.79 KiB 43.55 KiB -1.24 KiB

🔗 RealWorld

@datadog-official
Copy link
Copy Markdown

datadog-official bot commented Mar 13, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 77.21% (+0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 02e76a0 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

This helps understanding why the e2e tests are failing when the nextjs
test app isn't installed properly.
@BenoitZugmeyer BenoitZugmeyer merged commit ecedee2 into main Mar 16, 2026
21 checks passed
@BenoitZugmeyer BenoitZugmeyer deleted the benoit/e2e-offline-support branch March 16, 2026 09:53
@github-actions github-actions bot locked and limited conversation to collaborators Mar 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants