mirror of
				https://github.com/golang/go.git
				synced 2025-10-31 00:30:57 +00:00 
			
		
		
		
	net: fix data race in benchmarks
Fixes #10307. Change-Id: If70f36a6f1c4e465a47a0bc4d38b318424111106 Reviewed-on: https://go-review.googlesource.com/8330 Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
		
							parent
							
								
									9b696be08b
								
							
						
					
					
						commit
						93553dd216
					
				
					 6 changed files with 24 additions and 32 deletions
				
			
		|  | @ -219,8 +219,7 @@ func TestReloadResolvConfChange(t *testing.T) { | |||
| } | ||||
| 
 | ||||
| func BenchmarkGoLookupIP(b *testing.B) { | ||||
| 	uninstallTestHooks() | ||||
| 	defer installTestHooks() | ||||
| 	testHookUninstaller.Do(func() { uninstallTestHooks() }) | ||||
| 
 | ||||
| 	for i := 0; i < b.N; i++ { | ||||
| 		goLookupIP("www.example.com") | ||||
|  | @ -228,8 +227,7 @@ func BenchmarkGoLookupIP(b *testing.B) { | |||
| } | ||||
| 
 | ||||
| func BenchmarkGoLookupIPNoSuchHost(b *testing.B) { | ||||
| 	uninstallTestHooks() | ||||
| 	defer installTestHooks() | ||||
| 	testHookUninstaller.Do(func() { uninstallTestHooks() }) | ||||
| 
 | ||||
| 	for i := 0; i < b.N; i++ { | ||||
| 		goLookupIP("some.nonexistent") | ||||
|  | @ -237,8 +235,7 @@ func BenchmarkGoLookupIPNoSuchHost(b *testing.B) { | |||
| } | ||||
| 
 | ||||
| func BenchmarkGoLookupIPWithBrokenNameServer(b *testing.B) { | ||||
| 	uninstallTestHooks() | ||||
| 	defer installTestHooks() | ||||
| 	testHookUninstaller.Do(func() { uninstallTestHooks() }) | ||||
| 
 | ||||
| 	onceLoadConfig.Do(loadDefaultConfig) | ||||
| 	if cfg.dnserr != nil || cfg.dnsConfig == nil { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Mikio Hara
						Mikio Hara