fix(test): stabilize DNS availability tests with deterministic records and shorter retries
This commit is contained in:
+4
-7
@@ -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();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user