Skip to content

Commit c68eef6

Browse files
committed
change dns prefetch test case
1 parent 39d2334 commit c68eef6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

QiniuSDKTests/QNDnsPrefetcherTest.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,12 @@ - (void)testClearCache{
166166
NSString *host = @"uplog.qbox.me";
167167
dispatch_group_t group = dispatch_group_create();
168168

169+
int times = 10;
169170
dispatch_group_async(group, dispatch_get_global_queue(0, 0), ^{
170171
dispatch_group_enter(group);
171172
[kQNDnsPrefetch prefetchHostBySafeDns:host error:nil];
172-
for (int i=0; i<1000000; i++) {
173-
for (int i=0; i<100000; i++) {
173+
for (int i=0; i<times; i++) {
174+
for (int i=0; i<times; i++) {
174175
[kQNDnsPrefetch prefetchHostBySafeDns:[NSString stringWithFormat:@"%d%@", i, host] error:nil];
175176
}
176177
[NSThread sleepForTimeInterval:0.0001];
@@ -180,7 +181,7 @@ - (void)testClearCache{
180181

181182
dispatch_group_async(group, dispatch_get_global_queue(0, 0), ^{
182183
dispatch_group_enter(group);
183-
for (int i=0; i<100000; i++) {
184+
for (int i=0; i<times; i++) {
184185
[kQNDnsPrefetch clearDnsCache:nil];
185186
[NSThread sleepForTimeInterval:0.001];
186187
}

0 commit comments

Comments
 (0)