Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Failing CI tests #1118

Closed
Xanewok opened this issue Nov 9, 2018 · 18 comments
Closed

Failing CI tests #1118

Xanewok opened this issue Nov 9, 2018 · 18 comments

Comments

@Xanewok
Copy link
Member

Xanewok commented Nov 9, 2018

For some time now, the CI seems to fail on tooltip tests and test_rename: https://travis-ci.org/rust-lang-nursery/rls/jobs/452854404#L1519

@nrc
Copy link
Member

nrc commented Nov 11, 2018

Problem is due to multiple defs from save-analysis. Working on fixing it.

@nrc
Copy link
Member

nrc commented Nov 14, 2018

With rust-lang/rust#55936 and the most recent changes to rls-analysis, we are now passing rename, however, we now fail deglob and find_impls :-(

@nrc
Copy link
Member

nrc commented Nov 14, 2018

OK, I have all tests passing locally. Needs rust-lang/rust#55936 to land and get into nightly to pass everywhere.

@norru
Copy link

norru commented Nov 14, 2018

Possibly root cause of #1122

@Xanewok
Copy link
Member Author

Xanewok commented Nov 14, 2018

On a separate note, the cmd_changing_workspace_lib_retains_bin_diagnostics test intermittently fails in Rust CI (e.g. rust-lang/rust#55934 (comment)).

What happens is there are 2 packages, a binary and a library. The test checks if, by changing the type signature in the library function, the change is propagated and binary reports an error. Unfortunately, what happens, is:

[
  {
    "jsonrpc": "2.0",
    "method": "textDocument/publishDiagnostics",
    "params": {
      "diagnostics": [
        {
          "code": "E0425",
          "message": "cannot find function `fetch_u32` in module `library`\n\nnot found in `library`",
          "range": {
            "end": {
              "character": 53,
              "line": 4
            },
            "start": {
              "character": 44,
              "line": 4
            }
          },
          "severity": 1,
          "source": "rustc"
        }
      ],
      "uri": "file:///checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/rlsit/t1/simple_workspace/binary/src/main.rs"
    }
  },
  {
    "jsonrpc": "2.0",
    "method": "textDocument/publishDiagnostics",
    "params": {
      "diagnostics": [
        {
          "code": "E0308",
          "message": "mismatched types\n\nexpected u32, found u64",
          "range": {
            "end": {
              "character": 62,
              "line": 9
            },
            "start": {
              "character": 44,
              "line": 9
            }
          },
          "severity": 1,
          "source": "rustc"
        },
        {
          "code": "unused_variables",
          "message": "unused variable: `unused`\n\nnote: #[warn(unused_variables)] on by default\nhelp: consider using `_unused` instead: `_unused`",
          "range": {
            "end": {
              "character": 30,
              "line": 2
            },
            "start": {
              "character": 24,
              "line": 2
            }
          },
          "severity": 2,
          "source": "rustc"
        }
      ],
      "uri": "file:///checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/rlsit/t1/simple_workspace/library/src/lib.rs"
    }
  }
]

We expect

          "code": "E0308",
          "message": "mismatched types\n\nexpected u32, found u64",

for the binary/src/main.rs but unfortunately we end up with

          "code": "E0425",
          "message": "cannot find function `fetch_u32` in module `library`\n\nnot found in `library`",

which is weird. I tried to reproduce it locally but couldn't.
What could cause that? Maybe there's a race condition? But we only change the return type, the fetch_u32 function should be there, either before or after the mentioned change. Spooky stuff 👻

@Xanewok
Copy link
Member Author

Xanewok commented Nov 14, 2018

Another case in rust-lang/rust#55947 (comment), seems like it just started happening with basically almost every PR now?

@alexheretic
Copy link
Member

alexheretic commented Nov 19, 2018

There are 4 remaining failures in the enable_tooltip_tests suite. They do seem to mostly reflect hover functionality regressions which seem to also be present in the current nightly release.

1. enum variant name change

Stable vs Nightly

Stable

enum-name-change

Nightly

enum-name-change-new

2. enum variant missing hover

Stable vs Nightly

Stable

enum-name-gone

Nightly

enum-name-gone-new

3. Vec::<u32>::default() missing hover

Stable vs Nightly

Stable

default-gone

Nightly

default-gone-new

4. More module hovers include a link

This one at least can just be updated as it isn't a regression.

Stable vs Nightly

Stable

mod-link

Nightly

mod-link-new

Xanewok added a commit to Xanewok/rls that referenced this issue Nov 20, 2018
It seems that Racer got smarter? 🤷
rust-lang#1118
@alexheretic
Copy link
Member

Cool these 4 seem to be addressed now, nice one @Xanewok!

@Xanewok
Copy link
Member Author

Xanewok commented Nov 21, 2018

paths/variants were fixed by rust-lang/rust#56060 so that would be @nrc's doing :)

What's worrying is that we have macOS-specific tooltip failures and they seem to like we're not able to show type definitions in those tooltips.

I don't have access to a macOS machine, so I can't really dig into that - if some of you have, could you verify some of these failures and see if there's a problem with type definition on hover in general?

@alexheretic
Copy link
Member

alexheretic commented Nov 28, 2018

Now we have 1 hover test failing
expected: { language: "rust", value: "liballoc/string.rs" }, actual: { language: "rust", value: "src/liballoc/string.rs" }

I haven't been following the upstream change closely enough to know which one is best. Maybe we can just update the test?

Update: I got the expected/actual the wrong way round the first time.

@Xanewok
Copy link
Member Author

Xanewok commented Nov 28, 2018

Yeah we should - it’s due to rust-lang/rust#53586.

@alexheretic
Copy link
Member

Actually I got expected/actual reversed there, fixed now. So I think the test is correct, and we shouldn't be seeing the src/ prefix. Is that right?

@Xanewok
Copy link
Member Author

Xanewok commented Nov 29, 2018

Fixed that in #1155.

@aloucks
Copy link
Contributor

aloucks commented Nov 29, 2018

I don't believe the src prefix used to show up before.

@alexheretic
Copy link
Member

We're almost there now with Windows builds passing. But it looks like the mac tooltip tests are a bit flaky, they sometimes pass, sometimes fail.

@Xanewok
Copy link
Member Author

Xanewok commented Dec 10, 2018

In the https://travis-ci.org/rust-lang/rls/jobs/465961072 (#1152) failure it looks like we get type definition from the Racer fallback but we expect the rls-analysis info.

We should only execute the fallback when we don't have the type info, correct?

@alexheretic
Copy link
Member

Yep it should be fallback on error.

rls/src/actions/hover.rs

Lines 899 to 913 in c84b8ad

let hover_span_def = hover_span_def.or_else(|e| {
debug!(
"tooltip: racer_fallback_enabled: {}",
racer_fallback_enabled
);
if racer_fallback_enabled {
debug!("tooltip: span_def is empty, attempting with racer");
racer_def(&ctx, &hover_span).ok_or_else(|| {
debug!("tooltip: racer returned an empty result");
e
})
} else {
Err(e)
}
});

This is why it would perhaps be clearer to have tests that are for analysis only, in these we'll disable racer_completion. Additionally we could have racer ones, that are known to not work from analysis maybe.

Right now it's hard to know which bit is meant to work.

@Xanewok
Copy link
Member Author

Xanewok commented Dec 17, 2018

Rest of tests work correctly now, closing this in favor of #1151 since that test needs some work and fails intermittently on macOS.

@Xanewok Xanewok closed this as completed Dec 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants