Commit e8ca995
authored
(fix): Fixed flaky test TestReadDirSymlink that frequently failed in CI environments due to platform-specific filesystem issues. (#22743)
### Problem
The test was failing with high probability in CI with errors like:
FSEventStreamStart errors on macOS
Path mismatches due to symlink resolution (/var vs /private/var)
panic: index out of range [0] when filesystem watching failed
### Root Causes
Symlink path inconsistency: macOS resolves /var to /private/var, causing path comparison failures
Filesystem watching failures: notify.Watch() can fail on macOS, Docker containers, and restricted CI environments
Temporary directory paths: os.MkdirTemp() may return paths containing symlinks that need normalization
### Changes
Normalize root path with filepath.EvalSymlinks() at test start
Make filesystem watching failures non-fatal (changed from assert to warning log)
Fix symlink comparison by using EvalSymlinks on both sides
Handle nil event channel gracefully
Approved by: @ouyuanning1 parent 178a1fd commit e8ca995
1 file changed
+20
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
389 | 389 | | |
390 | 390 | | |
391 | 391 | | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
392 | 397 | | |
393 | 398 | | |
394 | 399 | | |
395 | 400 | | |
396 | 401 | | |
397 | 402 | | |
398 | | - | |
399 | | - | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
400 | 411 | | |
401 | 412 | | |
402 | 413 | | |
403 | 414 | | |
404 | 415 | | |
405 | 416 | | |
406 | 417 | | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
407 | 421 | | |
408 | 422 | | |
409 | 423 | | |
| |||
446 | 460 | | |
447 | 461 | | |
448 | 462 | | |
449 | | - | |
| 463 | + | |
450 | 464 | | |
451 | 465 | | |
452 | | - | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
453 | 469 | | |
454 | 470 | | |
455 | 471 | | |
| |||
0 commit comments