@@ -170,19 +170,40 @@ suite('Integration: Python Projects', function () {
170170 const project = projects [ 0 ] ;
171171 const env = environments [ 0 ] ;
172172
173+ // Diagnostic logging for CI debugging
174+ console . log ( `[TEST DEBUG] Project URI: ${ project . uri . fsPath } ` ) ;
175+ console . log ( `[TEST DEBUG] Setting environment with envId: ${ env . envId . id } ` ) ;
176+ console . log ( `[TEST DEBUG] Environment path: ${ env . environmentPath ?. fsPath } ` ) ;
177+ console . log ( `[TEST DEBUG] Total environments available: ${ environments . length } ` ) ;
178+ environments . forEach ( ( e , i ) => {
179+ console . log ( `[TEST DEBUG] env[${ i } ]: ${ e . envId . id } (${ e . displayName } )` ) ;
180+ } ) ;
181+
173182 // Set environment for project
174183 await api . setEnvironment ( project . uri , env ) ;
175184
185+ // Track what getEnvironment returns during polling for diagnostics
186+ let pollCount = 0 ;
187+ let lastRetrievedId : string | undefined ;
188+
176189 // Wait for the environment to be retrievable with the correct ID
177190 // This handles async persistence across platforms
178191 // Use 15s timeout - CI runners (especially macos) can be slow with settings persistence
179192 await waitForCondition (
180193 async ( ) => {
181194 const retrieved = await api . getEnvironment ( project . uri ) ;
195+ pollCount ++ ;
196+ const retrievedId = retrieved ?. envId ?. id ;
197+ if ( retrievedId !== lastRetrievedId ) {
198+ console . log (
199+ `[TEST DEBUG] Poll #${ pollCount } : getEnvironment returned envId=${ retrievedId ?? 'undefined' } ` ,
200+ ) ;
201+ lastRetrievedId = retrievedId ;
202+ }
182203 return retrieved !== undefined && retrieved . envId . id === env . envId . id ;
183204 } ,
184205 15_000 ,
185- `Environment was not set correctly. Expected envId: ${ env . envId . id } ` ,
206+ `Environment was not set correctly. Expected envId: ${ env . envId . id } , last retrieved: ${ lastRetrievedId } ` ,
186207 ) ;
187208
188209 // Final verification
0 commit comments