1818 * the shell probe never runs.
1919 */
2020import { createHash } from 'node:crypto' ;
21+ import { execFileSync } from 'node:child_process' ;
2122import {
2223 cpSync ,
2324 existsSync ,
2425 mkdtempSync ,
26+ readFileSync ,
27+ readlinkSync ,
28+ readdirSync ,
2529 rmSync ,
30+ statSync ,
2631 writeFileSync ,
2732} from 'node:fs' ;
2833import { tmpdir } from 'node:os' ;
2934import path from 'node:path' ;
3035import { runTests } from '@vscode/test-electron' ;
36+
37+ // TEMPORARY (debug/linux-watcher): how many inotify instances the system is
38+ // currently holding — the ceiling that panel runs hit (max_user_instances).
39+ const countInotifyFds = ( ) : number => {
40+ let count = 0 ;
41+ for ( const entry of readdirSync ( '/proc' ) ) {
42+ if ( ! / ^ \d + $ / . test ( entry ) ) continue ;
43+ try {
44+ for ( const fd of readdirSync ( `/proc/${ entry } /fd` ) ) {
45+ const target = readlinkSync ( `/proc/${ entry } /fd/${ fd } ` ) ;
46+ if (
47+ target === 'anon_inode:inotify' ||
48+ target === 'anon_inode:[inotify]'
49+ ) {
50+ count += 1 ;
51+ }
52+ }
53+ } catch {
54+ // A process may exit between listing and reading; ignore.
55+ }
56+ }
57+ return count ;
58+ } ;
3159import { vscodeTestCachePath } from '../vscodeTestCache' ;
3260
3361// Repo-relative fixture dirs whose installs this slice needs. workspace-2 has
@@ -51,6 +79,41 @@ async function main() {
5179 'e2e/rstest/fixtures' ,
5280 ) ;
5381
82+ // TEMPORARY environment diagnostics for the debug/linux-watcher branch.
83+ // One-off lines in the job output so a runner-side copy of the failing
84+ // ecosystem-ci context can be compared against local/leg tracks.
85+ if ( process . env . CI === 'true' || process . env . RSTACK_DETECTION_DIAG === '1' ) {
86+ const procRoot = '/proc/sys/fs/inotify' ;
87+ try {
88+ console . error ( `[e2e-env] time ${ new Date ( ) . toISOString ( ) } ` ) ;
89+ console . error (
90+ `[e2e-env] node ${ process . version } ${ process . platform } ${ process . arch } ` ,
91+ ) ;
92+ console . error (
93+ `[e2e-env] fixtures ${ fixturesRoot } ` ,
94+ `root-dev=${ statSync ( fixturesRoot ) . dev } ` ,
95+ ) ;
96+ for ( const limit of [
97+ 'max_user_watches' ,
98+ 'max_user_instances' ,
99+ 'max_queued_events' ,
100+ ] ) {
101+ console . error (
102+ `[e2e-env] inotify ${ limit } ${ readFileSync ( `${ procRoot } /${ limit } ` , 'utf8' ) . trim ( ) } ` ,
103+ ) ;
104+ }
105+ console . error ( `[e2e-env] inotify instances in use: ${ countInotifyFds ( ) } ` ) ;
106+ console . error (
107+ `[e2e-env] df -T fixtures:\n${ execFileSync ( 'df' , [ '-T' , fixturesRoot ] , { encoding : 'utf8' } ) } ` ,
108+ ) ;
109+ console . error (
110+ `[e2e-env] toolchain override ${ process . env . RSTACK_E2E_TOOLCHAIN_OVERRIDES || '(unset)' } ` ,
111+ ) ;
112+ } catch ( error ) {
113+ console . error ( `[e2e-env] diagnostics failed: ${ error } ` ) ;
114+ }
115+ }
116+
54117 // The extension host loads `main` from `package.json`; an unbuilt repo would
55118 // otherwise fail deep inside VS Code with an unhelpful activation error.
56119 if ( ! existsSync ( path . join ( extensionDevelopmentPath , 'dist/extension.js' ) ) ) {
0 commit comments