mirror of
				https://github.com/microsoft/playwright.git
				synced 2025-06-26 21:40:17 +00:00 
			
		
		
		
	test: unflake 'should not include trace resources from the previous chunks' test (#30257)
This commit is contained in:
		
							parent
							
								
									1ef85015f3
								
							
						
					
					
						commit
						56a7adeb8a
					
				| @ -432,6 +432,7 @@ export class BrowserContext extends ChannelOwner<channels.BrowserContextChannel> | |||||||
|       this._browser._contexts.delete(this); |       this._browser._contexts.delete(this); | ||||||
|     this._browserType?._contexts?.delete(this); |     this._browserType?._contexts?.delete(this); | ||||||
|     this._disposeHarRouters(); |     this._disposeHarRouters(); | ||||||
|  |     this.tracing._resetStackCounter(); | ||||||
|     this.emit(Events.BrowserContext.Close, this); |     this.emit(Events.BrowserContext.Close, this); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -102,6 +102,7 @@ export class APIRequestContext extends ChannelOwner<channels.APIRequestContextCh | |||||||
|   async dispose(): Promise<void> { |   async dispose(): Promise<void> { | ||||||
|     await this._instrumentation.onWillCloseRequestContext(this); |     await this._instrumentation.onWillCloseRequestContext(this); | ||||||
|     await this._channel.dispose(); |     await this._channel.dispose(); | ||||||
|  |     this._tracing._resetStackCounter(); | ||||||
|     this._request?._contexts.delete(this); |     this._request?._contexts.delete(this); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -76,10 +76,7 @@ export class Tracing extends ChannelOwner<channels.TracingChannel> implements ap | |||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   private async _doStopChunk(filePath: string | undefined) { |   private async _doStopChunk(filePath: string | undefined) { | ||||||
|     if (this._isTracing) { |     this._resetStackCounter(); | ||||||
|       this._isTracing = false; |  | ||||||
|       this._connection.setIsTracing(false); |  | ||||||
|     } |  | ||||||
| 
 | 
 | ||||||
|     if (!filePath) { |     if (!filePath) { | ||||||
|       // Not interested in artifacts.
 |       // Not interested in artifacts.
 | ||||||
| @ -113,4 +110,11 @@ export class Tracing extends ChannelOwner<channels.TracingChannel> implements ap | |||||||
| 
 | 
 | ||||||
|     await this._connection.localUtils()._channel.zip({ zipFile: filePath, entries: [], mode: 'append', stacksId: this._stacksId, includeSources: this._includeSources }); |     await this._connection.localUtils()._channel.zip({ zipFile: filePath, entries: [], mode: 'append', stacksId: this._stacksId, includeSources: this._includeSources }); | ||||||
|   } |   } | ||||||
|  | 
 | ||||||
|  |   _resetStackCounter() { | ||||||
|  |     if (this._isTracing) { | ||||||
|  |       this._isTracing = false; | ||||||
|  |       this._connection.setIsTracing(false); | ||||||
|  |     } | ||||||
|  |   } | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Max Schmitt
						Max Schmitt