Skip to content

add a test for the getrandom fallback - #158125

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
joboet:getrandom-fallback-test
Jun 20, 2026
Merged

add a test for the getrandom fallback#158125
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
joboet:getrandom-fallback-test

Conversation

@joboet

@joboet joboet commented Jun 19, 2026

Copy link
Copy Markdown
Member

Now that the randomness API is nearing stabilisation, I think it'd be quite good to have a test for our getrandom fallback code to rule out any issues with the polling logic. This test uses symbol interposition to control the getrandom return value; I tried to make it as resilient to changes to the SystemRng-internals as possible.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 19, 2026
@rustbot

rustbot commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

r? @jackh726

rustbot has assigned @jackh726.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 73 candidates
  • Random selection from 19 candidates

@rust-log-analyzer

This comment has been minimized.

@joboet
joboet force-pushed the getrandom-fallback-test branch from 42bb07f to ac3bada Compare June 19, 2026 11:53
@joboet

joboet commented Jun 19, 2026

Copy link
Copy Markdown
Member Author

r? libs
I guess

@rustbot rustbot added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Jun 19, 2026
@rustbot rustbot assigned jhpratt and unassigned jackh726 Jun 19, 2026
@joboet joboet removed the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jun 19, 2026
@jhpratt

jhpratt commented Jun 19, 2026

Copy link
Copy Markdown
Member

@bors r+ rollup

@rust-bors

rust-bors Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

📌 Commit ac3bada has been approved by jhpratt

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 19, 2026
rust-bors Bot pushed a commit that referenced this pull request Jun 19, 2026
Rollup of 3 pull requests

Successful merges:

 - #149267 (fix: clarify that fs::rename on unix accepts targets that don't exist)
 - #158106 (Expand diagnostic for attributes on macro calls)
 - #158125 (add a test for the `getrandom` fallback)
@rust-bors
rust-bors Bot merged commit 82b925e into rust-lang:main Jun 20, 2026
13 checks passed
rust-timer added a commit that referenced this pull request Jun 20, 2026
Rollup merge of #158125 - joboet:getrandom-fallback-test, r=jhpratt

add a test for the `getrandom` fallback

Now that the randomness API is nearing stabilisation, I think it'd be quite good to have a test for our `getrandom` fallback code to rule out any issues with the polling logic. This test uses symbol interposition to control the `getrandom` return value; I tried to make it as resilient to changes to the `SystemRng`-internals as possible.
@rustbot rustbot added this to the 1.98.0 milestone Jun 20, 2026
@joboet joboet added the A-random Area: random data generation support label Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-random Area: random data generation support S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants