File tree 1 file changed +12
-6
lines changed
packages/google-cloud-dns/system-test
1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,12 @@ import {Metadata} from '@google-cloud/common';
27
27
const dns = new DNS ( ) ;
28
28
const DNS_DOMAIN = process . env . GCLOUD_TESTS_DNS_DOMAIN || 'gitnpm.com.' ;
29
29
30
+ const delayMs = async ( ms = 1000 ) => {
31
+ return new Promise ( resolve => {
32
+ setTimeout ( resolve , ms ) ;
33
+ } ) ;
34
+ } ;
35
+
30
36
// Only run the tests if there is a domain to test with.
31
37
describe ( 'dns' , ( ) => {
32
38
const ZONE_NAME = 'test-zone-' + uuid . v4 ( ) . substr ( 0 , 18 ) ;
@@ -117,12 +123,12 @@ describe('dns', () => {
117
123
ZONE . delete ( { force : true } , done ) ;
118
124
} ) ;
119
125
120
- it ( 'should return 0 or more zones' , done => {
121
- dns . getZones ( ( err , zones ) => {
122
- assert . ifError ( err ) ;
123
- assert ( zones ! . length >= 0 ) ;
124
- done ( ) ;
125
- } ) ;
126
+ // deal with eventual consistency of ZONE.create():
127
+ it ( 'should return 0 or more zones' , async function ( ) {
128
+ this . retries ( 3 ) ;
129
+ await delayMs ( 1000 ) ;
130
+ const zones = await dns . getZones ( ) ;
131
+ assert ( zones ! . length >= 0 ) ;
126
132
} ) ;
127
133
128
134
describe ( 'Zones' , ( ) => {
You can’t perform that action at this time.
0 commit comments