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

Non-deterministic ordering of @supports conditions #137

Open
lucacasonato opened this issue Apr 4, 2022 · 1 comment
Open

Non-deterministic ordering of @supports conditions #137

lucacasonato opened this issue Apr 4, 2022 · 1 comment

Comments

@lucacasonato
Copy link
Contributor

Just had this failure locally while running cargo test:

failures:

---- bundler::tests::test_bundle stdout ----
thread 'bundler::tests::test_bundle' panicked at 'assertion failed: `(left == right)`
  left: `"@supports ((foo: bar) or (color: red)) {\n  .b {\n    color: green;\n  }\n}\n\n.a {\n  color: red;\n}\n"`,
 right: `"@supports ((color: red) or (foo: bar)) {\n  .b {\n    color: green;\n  }\n}\n\n.a {\n  color: red;\n}\n"`', src/bundler.rs:685:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    bundler::tests::test_bundle

test result: FAILED. 76 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.04s

It seems to have occurred because the sort order of the @supports conditions is not deterministic.

@lucacasonato lucacasonato changed the title Non-deterministic @supports conditions Non-deterministic ordering of @supports conditions Apr 4, 2022
@lucacasonato lucacasonato changed the title Non-deterministic ordering of @supports conditions Non-deterministic ordering of @supports conditions Apr 4, 2022
@devongovett
Copy link
Member

Yeah I think it happens due to multi-threading. Probably should sort the results when combining @supports and @media queries.

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