Skip to content

Fix RWC missing file detection - #46673

Merged
Wesley Wigham (weswigham) merged 1 commit into
microsoft:mainfrom
weswigham:fix-rwc
Nov 9, 2021
Merged

Wesley Wigham (weswigham) merged 1 commit into
microsoft:mainfrom
weswigham:fix-rwc

Conversation

@weswigham

Copy link
Copy Markdown
Member

RWC has been failing for awhile (2 weeks); it wasn't really noticeable, since we still got normal diff PRs and merged them as needed, which seemed fine, but today I noticed that it was still failing even immediately after I merged an update PR - finding that suspect, I checked the logs and found out that pretty much every test was giving a spurious error saying it was missing every file in the test. Definitely not right. The story ended up being that #46086 made our readDirectory return absolute paths, while the rwc harness was very much relying on relative paths to perform a simple path comparison.

@andrewbranch

Copy link
Copy Markdown
Member

Hm, do we have an opinion on what the correct thing for readDirectory to return is? There seemed to be some internal inconsistency that led to a bug, but I didn't fully realize that fixing the bug also resulted in such an observable API change.

@weswigham

Copy link
Copy Markdown
Member Author

Hm, do we have an opinion on what the correct thing for readDirectory to return is?

I'd defer to Ron Buckton (@rbuckton) personally, since he probably knows what the intent was, since it was written to support file globbing, iirc.

@amcasey

Copy link
Copy Markdown
Member

For the record, I'm totally cool with rolling back the original change (#44710) - ideally just this part, but the whole thing if that's easier. It was a minor quality-of-life improvement (can enable exceptions during debugging with minimal noise).

@amcasey

Copy link
Copy Markdown
Member

Also, I'd expect to get names and not paths from readDirectory - I'm pretty sure that's what fs.readdir returns.

@weswigham
Wesley Wigham (weswigham) merged commit 4a065f5 into microsoft:main Nov 9, 2021
Andrew Branch (andrewbranch) added a commit to andrewbranch/TypeScript that referenced this pull request Nov 11, 2021
TypeScript Bot (typescript-bot) pushed a commit to typescript-bot/TypeScript that referenced this pull request Nov 11, 2021
Component commits:
931b504 Revert "Fix RWC missing file detection (microsoft#46673)"
This reverts commit 4a065f5.

afef282 Revert "Pass absolute path to directoryExists (microsoft#46086)"
This reverts commit 55b4928.

f1a20b3 Revert "Reduce exceptions (microsoft#44710)"
This reverts commit c0d5c29.

56842cd Add back system watcher limit
Andrew Branch (andrewbranch) added a commit that referenced this pull request Nov 11, 2021
* Revert "Fix RWC missing file detection (#46673)"

This reverts commit 4a065f5.

* Revert "Pass absolute path to directoryExists (#46086)"

This reverts commit 55b4928.

* Revert "Reduce exceptions (#44710)"

This reverts commit c0d5c29.

* Add back system watcher limit
Andrew Branch (andrewbranch) added a commit that referenced this pull request Nov 11, 2021
Component commits:
931b504 Revert "Fix RWC missing file detection (#46673)"
This reverts commit 4a065f5.

afef282 Revert "Pass absolute path to directoryExists (#46086)"
This reverts commit 55b4928.

f1a20b3 Revert "Reduce exceptions (#44710)"
This reverts commit c0d5c29.

56842cd Add back system watcher limit

Co-authored-by: Andrew Branch <andrew@wheream.io>
@rbuckton

Copy link
Copy Markdown
Contributor

Also, I'd expect to get names and not paths from readDirectory - I'm pretty sure that's what fs.readdir returns.

I mentioned this in #46788, but readDirectory wasn't intended to emulate fs.readdir. When globs were added, one of the requirements was that readDirectory return all of the matched results in one API call. This was because VSTS wanted to be able to swap out a call to readDirectory with one performed in-process to avoid the overhead of multiple round-trips from .NET to JavaScript using recursive calls that only returned file names.

Martin Probst (mprobst) pushed a commit to mprobst/TypeScript that referenced this pull request Jan 10, 2022
Martin Probst (mprobst) pushed a commit to mprobst/TypeScript that referenced this pull request Jan 10, 2022
…46787)

* Revert "Fix RWC missing file detection (microsoft#46673)"

This reverts commit 4a065f5.

* Revert "Pass absolute path to directoryExists (microsoft#46086)"

This reverts commit 55b4928.

* Revert "Reduce exceptions (microsoft#44710)"

This reverts commit c0d5c29.

* Add back system watcher limit
@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants