MCPcopy
hub / github.com/docmirror/dev-sidecar / test

Method test

packages/mitmproxy/src/lib/speed/SpeedTester.js:145–168  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

143 }
144
145 async test () {
146 if (this.isTesting) {
147 log.debug(`[speed] test skipped (already running): ${this.hostname}`)
148 return
149 }
150 this.isTesting = true
151 this.testCount++
152 log.debug(`[speed] test start: ${this.hostname}, testCount: ${this.testCount}`)
153
154 try {
155 const newList = await this.getIpListFromDns(this.dnsMap)
156 const newBackupList = [...newList, ...this.backupList]
157 this.backupList = _.unionBy(newBackupList, 'host')
158 await this.testBackups()
159 log.info(`[speed] test end: ${this.hostname} ➜ ip-list:`, this.backupList, `, testCount: ${this.testCount}`)
160 if (config.notify) {
161 config.notify({ key: 'test' })
162 }
163 } catch (e) {
164 log.error(`[speed] test failed: ${this.hostname}, testCount: ${this.testCount}, error:`, e)
165 } finally {
166 this.isTesting = false
167 }
168 }
169
170 async testBackups () {
171 if (this.isTestingBackups) {

Callers 15

constructorMethod · 0.95
pickFastAliveIpObjMethod · 0.95
startCheckerMethod · 0.95
regex.test.jsFile · 0.80
windowsFunction · 0.80
validateProxyIpFunction · 0.80
dnsSpeedTest.jsFile · 0.80
matchTest.jsFile · 0.80
isIPv6Function · 0.80
requestInterceptFunction · 0.80
reSpeedTestFunction · 0.80

Calls 2

getIpListFromDnsMethod · 0.95
testBackupsMethod · 0.95

Tested by

no test coverage detected