flatbuffers icon indicating copy to clipboard operation
flatbuffers copied to clipboard

Rust test failures do not block PRs

Open jtdavis777 opened this issue 8 months ago • 8 comments

The rust tests are not considered blocking failures for PRs. I am assuming because they used to be flaky, but I think that has been fixed.

@statxc or @RenzoMXD could one of you look into making these tests required again?

jtdavis777 avatar Mar 11 '26 15:03 jtdavis777

Hello @jtdavis777 Do you mean the tests in this PR https://github.com/google/flatbuffers/pull/8965 ?

ai-mountain avatar Mar 11 '26 15:03 ai-mountain

Hey @jtdavis777, thanks for the ping. I don't have admin access to the repo, so I'm unable to modify the branch protection rules. This would need someone with admin permissions to add the Rust test checks as required status checks under Settings > Branches > Branch protection rules.

statxc avatar Mar 11 '26 16:03 statxc

I think this is a bazel or ci issue, not a branch protection one, but I could be wrong

jtdavis777 avatar Mar 11 '26 16:03 jtdavis777

I also agree that https://github.com/google/flatbuffers/pull/8936 did good implementation for memory allocation. I will take more time to consider better solutions.

ai-mountain avatar Mar 11 '26 17:03 ai-mountain

@wlkrm tagging you as you may have missed my comment on your pr -- merging your fix caused some rust test failures. I'd like to get a PR in soon to fix these! https://github.com/google/flatbuffers/pull/8936#issuecomment-4040168977

jtdavis777 avatar Mar 12 '26 02:03 jtdavis777

@jtdavis777 Could you please check my PR https://github.com/google/flatbuffers/pull/8972? This passes the RustTesh.sh

Summary

The strings_pool field has two types depending on the std feature:

  • #[cfg(feature = "std")] → HashMap (line 146)
  • #[cfg(not(feature = "std"))] → Vec (line 148)

The first constructor (line 260-263) correctly uses #[cfg] guards to match. But the second constructor new_in_with_internal_capacity at line 297 always used Vec::with_capacity(...) — which is wrong when std is enabled because the field is a HashMap.

ai-mountain avatar Mar 12 '26 04:03 ai-mountain

@jtdavis777, sorry, I didn't know that the tests might fail without CI failing. I think @RenzoMXD has fixed it with his PR or should I still submit a fix? Thanks @RenzoMXD!

wlkrm avatar Mar 12 '26 06:03 wlkrm

@statxc I have read up on how this works and see what you are saying now. I don't have access either 😅

@wlkrm no need, #8972 should be fine once it gets sorted. Thanks!

jtdavis777 avatar Mar 12 '26 11:03 jtdavis777