File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,10 @@ test.describe("JupyterLab Benchmark", () => {
138
138
await page . dblclick ( `#filebrowser >> text=${ tmpPath } ` ) ;
139
139
140
140
const spinner = page . locator ( '[role="main"] >> .jp-SpinnerContent' ) ;
141
+ // Ensure there is no hanging document
142
+ while ( ( await spinner . count ( ) ) > 0 ) {
143
+ await spinner . first ( ) . waitFor ( { state : "hidden" } ) ;
144
+ }
141
145
142
146
const openTime = await perf . measure ( async ( ) => {
143
147
// Open the notebook and wait for the spinner to be hidden
@@ -147,7 +151,8 @@ test.describe("JupyterLab Benchmark", () => {
147
151
] ) ;
148
152
149
153
if ( ( await spinner . count ( ) ) > 0 ) {
150
- spinner . waitFor ( { state : "hidden" } ) ;
154
+ // They should be only one document
155
+ await spinner . waitFor ( { state : "hidden" } ) ;
151
156
}
152
157
} ) ;
153
158
@@ -193,8 +198,8 @@ test.describe("JupyterLab Benchmark", () => {
193
198
page . dblclick ( `#filebrowser >> text=${ filename } _copy.ipynb` ) ,
194
199
] ) ;
195
200
196
- if ( ( await spinner . count ( ) ) > 0 ) {
197
- spinner . waitFor ( { state : "hidden" } ) ;
201
+ while ( ( await spinner . count ( ) ) > 0 ) {
202
+ await spinner . first ( ) . waitFor ( { state : "hidden" } ) ;
198
203
}
199
204
}
200
205
You can’t perform that action at this time.
0 commit comments