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

Intermittent test failures #126

Open
fosskers opened this issue Jul 23, 2024 · 1 comment
Open

Intermittent test failures #126

fosskers opened this issue Jul 23, 2024 · 1 comment

Comments

@fosskers
Copy link
Contributor

fosskers commented Jul 23, 2024

The following tests within examples/library-fluent fail intermittently on master:

/// Test loading the `en` language.
#[test]
fn test_select_english() {
    localizer().select(&["en".parse().unwrap()]).unwrap();
    assert_eq!("Hello World!", &hello_world())
}

/// Test loading the `fr` language.
#[test]
fn test_select_french() {
    localizer().select(&["fr".parse().unwrap()]).unwrap();
    assert_eq!("Bonjour le monde!", &hello_world())
}

It sometimes takes many runs to see the failure, but it can be seen with:

cargo test --all-features -p library-fluent

The output of which is:

---- test_select_french stdout ----
thread 'test_select_french' panicked at i18n-embed/examples/library-fluent/tests/with_localizer.rs:41:5:
assertion `left == right` failed
  left: "Bonjour le monde!"
 right: "Hello World!"

Sometimes it's the English that fails, sometimes it's the French.

If I had to guess, I'd say something is either:

  • Using a HashMap internally and making an assumption about iteration order, or;
  • Pulling files from the filesystem and making an assumption about iteration order.

Neither of which can be done. Perhaps a sort should be done somewhere in the internals?

@kellpossible
Copy link
Owner

Thanks @fosskers I also noticed this! We should try to fix this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants