sway icon indicating copy to clipboard operation
sway copied to clipboard

test(lsp): inconsistent `go_to_definition_for_paths` test

Open spiral-ladder opened this issue 2 years ago • 3 comments

https://github.com/FuelLabs/sway/actions/runs/4310274360/jobs/7518550643

This test failed on the first run, but passed on triggering a re-run.

spiral-ladder avatar Mar 02 '23 04:03 spiral-ladder

These two unrelated PRs also had the same issue: https://github.com/FuelLabs/sway/actions/runs/4296935289/jobs/7489282684 https://github.com/FuelLabs/sway/actions/runs/4315841590/jobs/7530795852

esdrubal avatar Mar 02 '23 17:03 esdrubal

Happened again with additional logging: https://github.com/FuelLabs/sway/actions/runs/4347930396/jobs/7595847115

---- go_to_definition_for_paths stdout ----
thread 'go_to_definition_for_paths' panicked at 'Failed to deserialize response: Null input: Request {
    jsonrpc: Version,
    method: "textDocument/definition",
    params: Some(
        Object {
            "position": Object {
                "character": Number(39),
                "line": Number(6),
            },
            "textDocument": Object {
                "uri": String("file:///home/runner/work/sway/sway/sway-lsp/tests/fixtures/tokens/paths/src/main.sw"),
            },
        },
    ),
    id: Some(
        Number(
            61,
        ),
    ),
} error: data did not match any variant of untagged enum GotoDefinitionResponse', sway-lsp/tests/integration/lsp.rs:342:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Looks like it's not finding goto definitions for dfun on this line: use deep_mod::deeper_mod::deep_fun as dfun;

sdankel avatar Mar 06 '23 22:03 sdankel

We could try switching to cargo-nextest to get retries on flaky tests like this one. It should also speed up CI times in the sway repo overall.

sdankel avatar Jun 26 '23 19:06 sdankel