Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/ui/meta/revision-bad.rs#foo test failure on master #130996

Closed
onkoe opened this issue Sep 28, 2024 · 1 comment · Fixed by #131579
Closed

tests/ui/meta/revision-bad.rs#foo test failure on master #130996

onkoe opened this issue Sep 28, 2024 · 1 comment · Fixed by #131579
Assignees
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@onkoe
Copy link
Contributor

onkoe commented Sep 28, 2024

Hey there! I'm experiencing a weird issue where the tests/ui/meta/revision-bad.rs#foo test fails on the latest master branch commit when I run ./x test. The issue has occurred for me since at least 1b6d674 and still occurs now (e6eb451).

barrett@farts ~/D/p/c/rust (master)> ./x test tests/ui/meta/revision-bad.rs --verbose
# (snip)
running 2 tests
test [ui] tests/ui/meta/revision-bad.rs#bar ... ok
test [ui] tests/ui/meta/revision-bad.rs#foo ... FAILED

failures:

---- [ui] tests/ui/meta/revision-bad.rs#foo stdout ----


executing env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/home/barrett/Documents/projects/contributions/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/barrett/Documents/projects/contributions/rust/tests/ui/meta/revision-bad.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/home/barrett/.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/home/barrett/Documents/projects/contributions/rust/vendor" "--sysroot" "/home/barrett/Documents/projects/contributions/rust/build/x86_64-unknown-linux-gnu/stage1" "--target=x86_64-unknown-linux-gnu" "--cfg" "foo" "--check-cfg" "cfg(FALSE,foo,bar)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "-o" "/home/barrett/Documents/projects/contributions/rust/build/x86_64-unknown-linux-gnu/test/ui/meta/revision-bad.foo/a" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/home/barrett/Documents/projects/contributions/rust/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/home/barrett/Documents/projects/contributions/rust/build/x86_64-unknown-linux-gnu/test/ui/meta/revision-bad.foo/auxiliary"
------stdout------------------------------

------stderr------------------------------

------------------------------------------
executing cd "/home/barrett/Documents/projects/contributions/rust/build/x86_64-unknown-linux-gnu/test/ui/meta/revision-bad.foo" && RUSTC="/home/barrett/Documents/projects/contributions/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" RUST_TEST_THREADS="16" "/home/barrett/Documents/projects/contributions/rust/build/x86_64-unknown-linux-gnu/test/ui/meta/revision-bad.foo/a"
------stdout------------------------------

------stderr------------------------------
thread 'main' panicked at /home/barrett/Documents/projects/contributions/rust/tests/ui/meta/revision-bad.rs:13:5:
foo
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

------------------------------------------

NOTE: test did not panic as expected

failures:
    [ui] tests/ui/meta/revision-bad.rs#foo

test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured; 17696 filtered out; finished in 206.56ms

Here are the logs:

It feels like the test harness is failing to detect the panic - you can see in stderr that the panic occurs as expected, but the test asserts that it didn't! Oddly enough, revision-bad.rs#bar is detected correctly.

  • rustc --version --verbose
    
    barrett@farts ~/D/p/c/rust (master)> rustc +stage0 --version --verbose
    rustc 1.82.0-beta.4 (8c27a2ba6 2024-09-21)
    binary: rustc
    commit-hash: 8c27a2ba6b21f3406a51118643080f0591949827
    commit-date: 2024-09-21
    host: x86_64-unknown-linux-gnu
    release: 1.82.0-beta.4
    LLVM version: 19.1.0
    

    barrett@farts ~/D/p/c/rust (master)> rustc +stage1 --version --verbose
    rustc 1.83.0-dev
    binary: rustc
    commit-hash: unknown
    commit-date: unknown
    host: x86_64-unknown-linux-gnu
    release: 1.83.0-dev
    LLVM version: 19.1.0

  • System info
  • set -L
    
    barrett@farts ~/D/p/c/rust (master)> set -L
    BLACKBOX_THEMES_DIR /home/barrett/.var/app/com.raggesilver.BlackBox/data/blackbox/schemes
    CMD_DURATION 15
    COLORTERM truecolor
    COLUMNS 312
    CONDA_EXE /usr/bin/conda
    CONDA_PYTHON_EXE /usr/bin/python3
    CONDA_SHLVL 0
    DBUS_SESSION_BUS_ADDRESS unix:path=/run/user/1000/bus
    DESKTOP_SESSION gnome
    DISPLAY :0
    EDITOR micro
    ELECTRON_OZONE_PLATFORM_HINT auto
    EUID 1000
    FISH_VERSION 3.7.0
    FPATH /usr/share/lmod/lmod/init/ksh_funcs
    GDMSESSION gnome
    GDM_LANG en_US.UTF-8
    GNOME_SETUP_DISPLAY :1
    HOME /home/barrett
    IFS \n\ \t
    INVOCATION_ID 2d68f2bd14764060acf6609cc5722f95
    JOURNAL_STREAM 9:37990
    LANG en_US.UTF-8
    LINES 62
    LMOD_CMD /usr/share/lmod/lmod/libexec/lmod
    LMOD_DIR /usr/share/lmod/lmod/libexec
    LMOD_PKG /usr/share/lmod/lmod
    LMOD_ROOT /usr/share/lmod
    LMOD_VERSION 8.7.48
    LOGNAME barrett
    MANAGERPID 3389
    MEMORY_PRESSURE_WATCH /sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/app.slice/flatpak-session-helper.service/memory.pressure
    MEMORY_PRESSURE_WRITE c29tZSAyMDAwMDAgMjAwMDAwMAA=
    MODULESHOME /usr/share/lmod/lmod
    MOZ_GMP_PATH /usr/lib64/mozilla/plugins/gmp-gmpopenh264/system-installed
    PATH '/home/barrett/bin'  '/home/barrett/go/bin'  '/home/barrett/.local/bin'  '/home/barrett/.cargo/bin'  '/usr/condabin'  '/usr/local/bin'  '/usr/local/sbin'  '/usr/bin'  '/usr/sbin'
    PKG_CONFIG_PATH /usr/lib64/pkgconfig/
    PWD /home/barrett/Documents/projects/contributions/rust
    QT_IM_MODULE ibus
    SESSION_MANAGER local/unix:@/tmp/.ICE-unix/3587,unix/unix:/tmp/.ICE-unix/3587
    SHELL /usr/bin/fish
    SHLVL 1
    SSH_AUTH_SOCK /run/user/1000/keyring/ssh
    SYSTEMD_EXEC_PID 4670
    TERM xterm-256color
    TERM_PROGRAM BlackBox
    USER barrett
    USERNAME barrett
    VTE_VERSION 7300
    WAYLAND_DISPLAY wayland-0
    XAUTHORITY /run/user/1000/.mutter-Xwaylandauth.9RJQU2
    XDG_CURRENT_DESKTOP GNOME
    XDG_DATA_DIRS '/home/barrett/.local/share/flatpak/exports/share'  '/var/lib/flatpak/exports/share'  '/usr/local/share/'  '/usr/share/'
    XDG_MENU_PREFIX gnome-
    XDG_RUNTIME_DIR /run/user/1000
    XDG_SESSION_CLASS user
    XDG_SESSION_DESKTOP gnome
    XDG_SESSION_TYPE wayland
    XMODIFIERS @im=ibus
    _ set
    _CONDA_EXE /usr/bin/conda
    _CONDA_ROOT /usr
    ___fish_git_prompt_char_cleanstate
    ___fish_git_prompt_char_dirtystate '*'
    ___fish_git_prompt_char_invalidstate '#'
    ___fish_git_prompt_char_stagedstate +
    ___fish_git_prompt_char_stashstate '$'
    ___fish_git_prompt_char_stateseparator ' '
    ___fish_git_prompt_char_untrackedfiles '%'
    ___fish_git_prompt_char_upstream_ahead '>'
    ___fish_git_prompt_char_upstream_behind '<'
    ___fish_git_prompt_char_upstream_diverged '<>'
    ___fish_git_prompt_char_upstream_equal =
    ___fish_git_prompt_char_upstream_prefix
    ___fish_git_prompt_color
    ___fish_git_prompt_color_bare
    ___fish_git_prompt_color_bare_done
    ___fish_git_prompt_color_branch
    ___fish_git_prompt_color_branch_detached \e\[31m
    ___fish_git_prompt_color_branch_detached_done \e\(B\e\[m
    ___fish_git_prompt_color_branch_done
    ___fish_git_prompt_color_cleanstate
    ___fish_git_prompt_color_cleanstate_done
    ___fish_git_prompt_color_dirtystate
    ___fish_git_prompt_color_dirtystate_done
    ___fish_git_prompt_color_done
    ___fish_git_prompt_color_flags
    ___fish_git_prompt_color_flags_done
    ___fish_git_prompt_color_invalidstate
    ___fish_git_prompt_color_invalidstate_done
    ___fish_git_prompt_color_merging
    ___fish_git_prompt_color_merging_done
    ___fish_git_prompt_color_prefix
    ___fish_git_prompt_color_prefix_done
    ___fish_git_prompt_color_stagedstate
    ___fish_git_prompt_color_stagedstate_done
    ___fish_git_prompt_color_stashstate
    ___fish_git_prompt_color_stashstate_done
    ___fish_git_prompt_color_suffix
    ___fish_git_prompt_color_suffix_done
    ___fish_git_prompt_color_untrackedfiles
    ___fish_git_prompt_color_untrackedfiles_done
    ___fish_git_prompt_color_upstream
    ___fish_git_prompt_color_upstream_done
    ___fish_git_prompt_init
    __fish_active_key_bindings fish_default_key_bindings
    __fish_added_user_paths
    __fish_bin_dir /usr/bin
    __fish_cd_direction prev
    __fish_config_dir /home/barrett/.config/fish
    __fish_data_dir /usr/share/fish
    __fish_git_prompt_status_order 'stagedstate'  'invalidstate'  'dirtystate'  'untrackedfiles'  'stashstate'
    __fish_help_dir /usr/share/doc/fish
    __fish_initialized 3400
    __fish_last_bind_mode default
    __fish_machine
    __fish_prompt_status_generation 103
    __fish_sysconf_dir /etc/fish
    __fish_user_data_dir /home/barrett/.local/share/fish
    __fish_vendor_completionsdirs '/home/barrett/.local/share/fish/vendor_completions.d'  '/home/barrett/.local/share/flatpak/exports/share/fish/vendor_completions.d'  '/var/lib/flatpak/exports/share/fish/vendor_completions.d'  '/usr/local/share/fish/vendor_completions.d'  '/usr/share/fish/vendor_completions.d'
    __fish_vendor_confdirs '/home/barrett/.local/share/fish/vendor_conf.d'  '/home/barrett/.local/share/flatpak/exports/share/fish/vendor_conf.d'  '/var/lib/flatpak/exports/share/fish/vendor_conf.d'  '/usr/local/share/fish/vendor_conf.d'  '/usr/share/fish/vendor_conf.d'
    __fish_vendor_functionsdirs '/home/barrett/.local/share/fish/vendor_functions.d'  '/home/barrett/.local/share/flatpak/exports/share/fish/vendor_functions.d'  '/var/lib/flatpak/exports/share/fish/vendor_functions.d'  '/usr/local/share/fish/vendor_functions.d'  '/usr/share/fish/vendor_functions.d'
    __kill_signals '1 HUP'  '2 INT'  '3 QUIT'  '4 ILL'  '5 TRAP'  '6 ABRT'  '6 IOT'  '7 BUS'  '8 FPE'  '9 KILL'  '10 USR1'  '11 SEGV'  '12 USR2'  '13 PIPE'  '14 ALRM'  '15 TERM'  '16 STKFLT'  '17 CHLD'  '17 CLD'  '18 CONT'  '19 STOP'  '20 TSTP'  '21 TTIN'  '22 TTOU'  '23 URG'  '24 XCPU'  '25 XFSZ'  '26 VTALRM'  '27 PROF'  '28 WINCH'  '29 IO'  '29 POLL'  '30 PWR'  '31 SYS'  '34 RTMIN'  '64 RTMAX'
    dirprev '/home/barrett'  '/home/barrett/Documents'  '/home/barrett/Documents/projects'  '/home/barrett/Documents/projects/contributions'  '/home/barrett/Documents/projects/contributions/rust'  '/home/barrett/Documents/projects/contributions/rust/build'  '/home/barrett/Documents/projects/contributions/rust'  '/home/barrett/Documents/projects/contributions/rust/build'
    fish_bind_mode default
    fish_color_autosuggestion '555'  'brblack'
    fish_color_cancel -r
    fish_color_command blue
    fish_color_comment red
    fish_color_cwd green
    fish_color_cwd_root red
    fish_color_end green
    fish_color_error brred
    fish_color_escape brcyan
    fish_color_hg_added green
    fish_color_hg_clean green
    fish_color_hg_copied magenta
    fish_color_hg_deleted red
    fish_color_hg_dirty red
    fish_color_hg_modified yellow
    fish_color_hg_renamed magenta
    fish_color_hg_unmerged red
    fish_color_hg_untracked yellow
    fish_color_history_current --bold
    fish_color_host normal
    fish_color_host_remote yellow
    fish_color_normal normal
    fish_color_operator brcyan
    fish_color_param cyan
    fish_color_quote yellow
    fish_color_redirection 'cyan'  '--bold'
    fish_color_search_match --background=111
    fish_color_selection 'white'  '--bold'  '--background=brblack'
    fish_color_status red
    fish_color_user brgreen
    fish_color_valid_path --underline
    fish_complete_path '/home/barrett/.config/fish/completions'  '/etc/fish/completions'  '/home/barrett/.local/share/fish/vendor_completions.d'  '/home/barrett/.local/share/flatpak/exports/share/fish/vendor_completions.d'  '/var/lib/flatpak/exports/share/fish/vendor_completions.d'  '/usr/local/share/fish/vendor_completions.d'  '/usr/share/fish/vendor_completions.d'  '/usr/share/fish/completions'  '/home/barrett/.local/share/fish/generated_completions'
    fish_function_path '/home/barrett/.config/fish/functions'  '/etc/fish/functions'  '/home/barrett/.local/share/fish/vendor_functions.d'  '/home/barrett/.local/share/flatpak/exports/share/fish/vendor_functions.d'  '/var/lib/flatpak/exports/share/fish/vendor_functions.d'  '/usr/local/share/fish/vendor_functions.d'  '/usr/share/fish/vendor_functions.d'  '/usr/share/fish/functions'
    fish_greeting Welcome\ to\ fish,\ the\ friendly\ interactive\ shell\nType\ \e\[32mhelp\e\(B\e\[m\ for\ instructions\ on\ how\ to\ use\ fish
    fish_handle_reflow 0
    fish_key_bindings fish_default_key_bindings
    fish_kill_signal 0
    fish_killring 'meta/revision-bad'  'cargo-'  'fmt '  ' /home/barrett/Android/Sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/linux-x86_64/bin'  'home/barrett/Android/Sdk/emulator /home/barrett/.local/share/flutter_sdk/flutter/bin /home/barrett/.local/share/flutter_sdk/flutter /home/barrett/bin/android-studio/bin '  'home/barrett/.surrealdb'  ' /home/barrett/.rye/shims'  ' /home/linuxbrew/.linuxbrew/bin'  '-help'  '-verbos'  'library'  'check libra'  'build lib'
    fish_pager_color_completion normal
    fish_pager_color_description 'B3A06D'  'yellow'  '-i'
    fish_pager_color_prefix 'cyan'  '--bold'  '--underline'
    fish_pager_color_progress 'brwhite'  '--background=cyan'
    fish_pager_color_selected_background -r
    fish_pid 471878
    fish_prompt_hg_status_added ✚
    fish_prompt_hg_status_copied ⇒
    fish_prompt_hg_status_deleted ✖
    fish_prompt_hg_status_modified '*'
    fish_prompt_hg_status_order 'added'  'modified'  'copied'  'deleted'  'untracked'  'unmerged'
    fish_prompt_hg_status_unmerged !
    fish_prompt_hg_status_untracked '?'
    fish_user_paths '/home/barrett/Android/Sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/linux-x86_64/bin'  '/home/barrett/Android/Sdk/emulator'  '/home/barrett/.local/share/flutter_sdk/flutter/bin'  '/home/barrett/.local/share/flutter_sdk/flutter'  '/home/barrett/bin/android-studio/bin'  '/home/barrett/.surrealdb'  '/home/barrett/bin'  '/home/barrett/.rye/shims'  '/home/barrett/go/bin'  '/home/linuxbrew/.linuxbrew/bin'  '/home/barrett/.local/bin'  '/home/barrett/.cargo/bin'
    history # (snip! veeeery long)
    hostname farts
    last_pid 2083778
    pipestatus 0
    status 0
    status_generation 103
    umask 0022
    version 3.7.0
    barrett@farts ~/D/p/c/rust (master)> 
    
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 28, 2024
@jieyouxu jieyouxu added A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Sep 28, 2024
@jieyouxu jieyouxu self-assigned this Sep 28, 2024
@jieyouxu
Copy link
Member

jieyouxu commented Oct 12, 2024

It feels like the test harness is failing to detect the panic - you can see in stderr that the panic occurs as expected, but the test asserts that it didn't! Oddly enough, revision-bad.rs#bar is detected correctly.

It's actually because your username barrett contains bar, which the foo revision is explicitly checking to make sure that it is not present in test run stderr. But that is present in the panic backtrace of test stderr because the panic backtrace contains a path including your username. In #131579 I'm fixing it by remapping the path prefix so the panic backtrace paths are predictable and does not include username info or intermediate folders.

tgross35 added a commit to tgross35/rust that referenced this issue Oct 12, 2024
…iler-errors

Remap path prefix in the panic message of `tests/ui/meta/revision-bad.rs`

Otherwise `error-pattern` on the test run stderr can incorrectly match if the paths in panic backtrace has a matching substring (like if we look for `bar` in the error pattern, but the username is `baron`).

Tested locally by checking run output `./x test .\tests\ui\meta\revision-bad.rs -- -- --nocapture`:

```
--- stderr -------------------------------
thread 'main' panicked at remapped\meta\revision-bad.rs:14:5:
foo
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
------------------------------------------
```

Fixes rust-lang#130996.
@bors bors closed this as completed in 507dd63 Oct 13, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Oct 13, 2024
Rollup merge of rust-lang#131579 - jieyouxu:ui-panic-username, r=compiler-errors

Remap path prefix in the panic message of `tests/ui/meta/revision-bad.rs`

Otherwise `error-pattern` on the test run stderr can incorrectly match if the paths in panic backtrace has a matching substring (like if we look for `bar` in the error pattern, but the username is `baron`).

Tested locally by checking run output `./x test .\tests\ui\meta\revision-bad.rs -- -- --nocapture`:

```
--- stderr -------------------------------
thread 'main' panicked at remapped\meta\revision-bad.rs:14:5:
foo
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
------------------------------------------
```

Fixes rust-lang#130996.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants