fix(test): stabilize DNS availability tests with deterministic records and shorter retries

This commit is contained in:
2026-04-30 12:59:05 +00:00
parent dcfed89115
commit e1d46c6b43
4 changed files with 12 additions and 9 deletions
+4 -7
View File
@@ -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();
});