From e1d46c6b435a39ab68a481bc49dcf4aa1db6cc32 Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Thu, 30 Apr 2026 12:59:05 +0000 Subject: [PATCH] fix(test): stabilize DNS availability tests with deterministic records and shorter retries --- changelog.md | 6 ++++++ license | 2 +- test/test.client.ts | 11 ++++------- ts/00_commitinfo_data.ts | 2 +- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/changelog.md b/changelog.md index 095cfc1..ae34da0 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # Changelog +## 2026-04-30 - 7.9.2 - fix(test) +stabilize DNS availability tests with deterministic records and shorter retries + +- replace the external TXT record lookup with a localhost A record check to avoid network-dependent test behavior +- reduce retry count and delay in failing checkUntilAvailable assertions to keep test runs faster and more predictable + ## 2026-04-30 - 7.9.1 - fix(client,testing,build) improve TypeScript compatibility for DNS client parsing and test suite diff --git a/license b/license index b249dfc..7583a48 100644 --- a/license +++ b/license @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 Push.Rocks +Copyright (c) 2016 Task Venture Capital GmbH Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/test.client.ts b/test/test.client.ts index d7779a2..945957c 100644 --- a/test/test.client.ts +++ b/test/test.client.ts @@ -45,22 +45,19 @@ tap.test('should get a mx record for a domain (system)', async () => { }); tap.test('should check until DNS is available', async () => { - const records = await testDnsClient.getRecordsTxt('google.com'); - if (records.length > 0) { - const result = await testDnsClient.checkUntilAvailable('google.com', 'TXT', records[0].value); - expect(result).toBeTrue(); - } + const result = await testDnsClient.checkUntilAvailable('localhost', 'A', '127.0.0.1', 4, 50); + expect(result).toBeTrue(); }); tap.test('should check until DNS is available and return false if it fails', async () => { return expect( - await testDnsClient.checkUntilAvailable('google.com', 'TXT', 'this-txt-record-does-not-exist') + await testDnsClient.checkUntilAvailable('google.com', 'TXT', 'this-txt-record-does-not-exist', 2, 50) ).toBeFalse(); }); tap.test('should check until DNS is available and return false if it fails', async () => { return expect( - await testDnsClient.checkUntilAvailable('nonexistent.example.com', 'TXT', 'sometext_txt2') + await testDnsClient.checkUntilAvailable('nonexistent.example.com', 'TXT', 'sometext_txt2', 2, 50) ).toBeFalse(); }); diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 0e33e1d..483e042 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@push.rocks/smartdns', - version: '7.9.1', + version: '7.9.2', description: 'A robust TypeScript library providing advanced DNS management and resolution capabilities including support for DNSSEC, custom DNS servers, and integration with various DNS providers.' }