Skip to content

Conversation

@dfangl
Copy link
Member

@dfangl dfangl commented Dec 11, 2025

Motivation

Currently our DNS tests are marked as unit tests. However, they are not actually unit tests, as they test the end to end behavior of the DNS server, including calls to upstream DNS servers.

This PR will correctly move them to the integration tests. (cc @peter-smith-phd)

Also, recently it seems that example.org was moved to cloudflare DNS, which leads to a different response code for one of our queries - NOERROR (with an empty response) instead of NXDOMAIN.

By moving to example.com for this test we for now circumvent this issue - as a simple change in the assertion is not sufficient, since this change is still not propagated everywhere (and might even change in the future again).

Changes

  • Move DNS test suite to integration tests
  • Use example.com domain for skipped tests to reenable.

Tests

Related

Fixes UNC-164

@dfangl dfangl added semver: patch Non-breaking changes which can be included in patch releases docs: skip Pull request does not require documentation changes notes: skip Pull request does not have to be mentioned in the release notes labels Dec 11, 2025
@dfangl dfangl requested review from joe4dev and simonrw December 11, 2025 18:01
@github-actions
Copy link

github-actions bot commented Dec 11, 2025

Test Results - Preflight, Unit

22 979 tests   - 22   21 137 ✅  - 21   6m 22s ⏱️ -1s
     1 suites ± 0    1 842 💤  -  1 
     1 files   ± 0        0 ❌ ± 0 

Results for commit 8a2dabc. ± Comparison against base commit ca6b22b.

This pull request removes 22 tests.
tests.unit.test_dns_server.TestDNSServer ‑ test_delete_operations_of_nonexistent_entries
tests.unit.test_dns_server.TestDNSServer ‑ test_dns_server_add_alias_lifecycle_with_ids
tests.unit.test_dns_server.TestDNSServer ‑ test_dns_server_add_host_lifecycle
tests.unit.test_dns_server.TestDNSServer ‑ test_dns_server_add_host_lifecycle_with_ids
tests.unit.test_dns_server.TestDNSServer ‑ test_dns_server_add_multiple_hosts
tests.unit.test_dns_server.TestDNSServer ‑ test_dns_server_alias_health_checks
tests.unit.test_dns_server.TestDNSServer ‑ test_dns_server_alias_lifecycle
tests.unit.test_dns_server.TestDNSServer ‑ test_dns_server_clear
tests.unit.test_dns_server.TestDNSServer ‑ test_dns_server_fallback
tests.unit.test_dns_server.TestDNSServer ‑ test_dns_server_resolves_alias_wildcards
…

♻️ This comment has been updated with latest results.

@github-actions
Copy link

LocalStack Community integration with Pro

2 files  2 suites   35s ⏱️
2 tests 0 ✅ 2 💤 0 ❌
4 runs  0 ✅ 4 💤 0 ❌

Results for commit 8a2dabc.

dns_server.add_host("example.org", TargetRecord("127.0.0.1", RecordType.A))
answer = query_dns("nonexistent.example.org", "A")
dns_server.add_host("example.com", TargetRecord("127.0.0.1", RecordType.A))
answer = query_dns("nonexistent.example.com", "A")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually doesn't work for me. It's because nonexistent.example.com returns SERVFAIL rather than NXDOMAIN (although that might be temporary?)

Expected :<Rcode.NXDOMAIN: 3>
Actual   :<Rcode.SERVFAIL: 2>

These tests use the `example.org` and `example.com` domains for testing, and also tests the fallback to the public DNS
Changes in the upstream name resolution of those domains might lead to test failures.

TODO we should investigate creating our own test domain with a fixed behavior to avoid potential test failures
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is localstack.cloud something we could use? Unfortunately, creating an additional test domain would cost money, and the associated yearly management of keeping the domain alive.

@github-actions
Copy link

Test Results (amd64) - Acceptance

7 tests  ±0   5 ✅ ±0   2m 59s ⏱️ -4s
1 suites ±0   2 💤 ±0 
1 files   ±0   0 ❌ ±0 

Results for commit 8a2dabc. ± Comparison against base commit ca6b22b.

@github-actions
Copy link

Test Results (amd64) - Integration, Bootstrap

 5 files  ±    0   5 suites  ±0   9m 21s ⏱️ - 2h 26m 6s
48 tests  - 5 473  46 ✅  - 4 919  2 💤  - 554  0 ❌ ±0 
54 runs   - 5 473  46 ✅  - 4 919  8 💤  - 554  0 ❌ ±0 

Results for commit 8a2dabc. ± Comparison against base commit ca6b22b.

This pull request removes 5495 and adds 22 tests. Note that renamed tests count towards both.
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_lambda_dynamodb
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_opensearch_crud
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_search_books
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_setup
tests.aws.scenario.kinesis_firehose.test_kinesis_firehose.TestKinesisFirehoseScenario ‑ test_kinesis_firehose_s3
tests.aws.scenario.lambda_destination.test_lambda_destination_scenario.TestLambdaDestinationScenario ‑ test_destination_sns
tests.aws.scenario.lambda_destination.test_lambda_destination_scenario.TestLambdaDestinationScenario ‑ test_infra
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_prefill_dynamodb_table
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_stepfunctions_input_recipient_list[step_function_input0-SUCCEEDED]
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_stepfunctions_input_recipient_list[step_function_input1-SUCCEEDED]
…
tests.integration.dns.test_dns_server.TestDNSServer ‑ test_delete_operations_of_nonexistent_entries
tests.integration.dns.test_dns_server.TestDNSServer ‑ test_dns_server_add_alias_lifecycle_with_ids
tests.integration.dns.test_dns_server.TestDNSServer ‑ test_dns_server_add_host_lifecycle
tests.integration.dns.test_dns_server.TestDNSServer ‑ test_dns_server_add_host_lifecycle_with_ids
tests.integration.dns.test_dns_server.TestDNSServer ‑ test_dns_server_add_multiple_hosts
tests.integration.dns.test_dns_server.TestDNSServer ‑ test_dns_server_alias_health_checks
tests.integration.dns.test_dns_server.TestDNSServer ‑ test_dns_server_alias_lifecycle
tests.integration.dns.test_dns_server.TestDNSServer ‑ test_dns_server_clear
tests.integration.dns.test_dns_server.TestDNSServer ‑ test_dns_server_fallback
tests.integration.dns.test_dns_server.TestDNSServer ‑ test_dns_server_resolves_alias_wildcards
…

Copy link
Contributor

@simonrw simonrw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these tests are inherently fragile unless we implement our own domain name but the overhead of that at the moment is IMO more than handling these issues every ~year or so.

@dfangl dfangl merged commit 4532ad6 into main Dec 15, 2025
74 of 75 checks passed
@dfangl dfangl deleted the dns/test-fixes branch December 15, 2025 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs: skip Pull request does not require documentation changes notes: skip Pull request does not have to be mentioned in the release notes semver: patch Non-breaking changes which can be included in patch releases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants