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

Hangs when used with fail-fast option #241

Closed
stepantubanov opened this issue Nov 3, 2022 · 2 comments · Fixed by #242
Closed

Hangs when used with fail-fast option #241

stepantubanov opened this issue Nov 3, 2022 · 2 comments · Fixed by #242
Assignees
Labels
bug Something isn't working k::UI/UX UI (user interface) and UX (user experience) changes
Milestone

Comments

@stepantubanov
Copy link

stepantubanov commented Nov 3, 2022

I think there may be a bug with --fail-fast behavior. I'm assuming it should force cucumber to exit on first failure. Instead I'm seeing step failure (as expected) and afterwards it just hangs (doesn't exit, seems to be stuck in an infinite loop somewhere).

# tests/scenarios
use cucumber::{then, World as _};

#[derive(cucumber::World, Debug, Default)]
struct World;

#[then(expr = "step panics")]
async fn step_panics(_: &mut World) {
    panic!("this is a panic message");
}

#[then(expr = "nothing happens")]
async fn nothing_happens(_: &mut World) {
    // noop
}

#[tokio::main]
async fn main() {
    World::cucumber()
        .max_concurrent_scenarios(1)
        .run_and_exit("tests/check.feature")
        .await;
}
# tests/check.feature
Feature: A
  Scenario: 1
    Then step panics

  Scenario: 2
    Then nothing happens

Cargo.toml:

...

[dependencies]
cucumber = "0.15"
tokio = { version = "1", features = ["full"] }

[[test]]
name = "scenarios"
harness = false

And run like this: cargo test --test scenarios -- --fail-fast

@tyranron tyranron added the bug Something isn't working label Nov 4, 2022
@tyranron tyranron added this to the 0.15.4 milestone Nov 4, 2022
@tyranron tyranron added the k::UI/UX UI (user interface) and UX (user experience) changes label Nov 4, 2022
@tyranron
Copy link
Member

tyranron commented Nov 9, 2022

@tyranron tyranron assigned tyranron and unassigned ilslv Nov 9, 2022
tyranron added a commit that referenced this issue Nov 9, 2022
Additionally:
- add `--ff` CLI alias for `--fail-fast` CLI option
@tyranron
Copy link
Member

tyranron commented Nov 9, 2022

@stepantubanov released in 0.16.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working k::UI/UX UI (user interface) and UX (user experience) changes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants