{"id":23816774,"url":"https://github.com/dfaust/repeated-assert","last_synced_at":"2026-06-22T22:31:28.771Z","repository":{"id":57660097,"uuid":"86098167","full_name":"dfaust/repeated-assert","owner":"dfaust","description":"An assertion macro that tries to assert expressions multiple times","archived":false,"fork":false,"pushed_at":"2023-12-16T10:43:35.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-05-22T15:40:55.745Z","etag":null,"topics":["helper","integration-testing","rust"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dfaust.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-24T18:17:59.000Z","updated_at":"2023-12-16T10:43:39.000Z","dependencies_parsed_at":"2025-02-21T20:44:12.229Z","dependency_job_id":"2af3c974-fab9-4e45-96ac-6b790456fbb7","html_url":"https://github.com/dfaust/repeated-assert","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/dfaust/repeated-assert","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfaust%2Frepeated-assert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfaust%2Frepeated-assert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfaust%2Frepeated-assert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfaust%2Frepeated-assert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dfaust","download_url":"https://codeload.github.com/dfaust/repeated-assert/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfaust%2Frepeated-assert/sbom","scorecard":{"id":338896,"data":{"date":"2025-08-11","repo":{"name":"github.com/dfaust/repeated-assert","commit":"12b21d301b2fa51f6cb5c7afde5966ba32a91a66"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE-MIT:0","Info: FSF or OSI recognized license: MIT License: LICENSE-MIT:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-18T05:19:52.413Z","repository_id":57660097,"created_at":"2025-08-18T05:19:52.413Z","updated_at":"2025-08-18T05:19:52.413Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34668500,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-22T02:00:06.391Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["helper","integration-testing","rust"],"created_at":"2025-01-02T04:32:17.266Z","updated_at":"2026-06-22T22:31:28.753Z","avatar_url":"https://github.com/dfaust.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# repeated-assert\n\n[![Crate version](https://img.shields.io/crates/d/repeated-assert)](https://crates.io/crates/repeated-assert)\n[![Documentation](https://img.shields.io/docsrs/repeated-assert)](https://docs.rs/repeated-assert)\n\nRun assertions multiple times\n\n`repeated_assert` runs assertions until they either pass\nor the maximum amount of repetitions has been reached.\nThe current thread will be blocked between tries.\n\nThis is useful when waiting for events from another thread (or process).\nWaiting for a short time might result in a failing test, while waiting too long is a waste of time.\n\n## Crate features\n\n* **async** - Enables the `that_async` and `with_catch_async` functions. It depends on the `futures` and `tokio` crates, which is why it's disabled by default.\n\n## Examples\n\nWaiting for a file to appear (re-try up to 10 times, wait 50 ms between tries)\n\n```rust,ignore\nrepeated_assert::that(10, Duration::from_millis(50), || {\n    assert!(Path::new(\"should_appear_soon.txt\").exists());\n});\n```\n\nWaiting for variable `x` to equal `3`\n\n```rust,ignore\nrepeated_assert::that(10, Duration::from_millis(50), || {\n    assert_eq!(x, 3);\n});\n```\n\nTemporary variables\n\n```rust,ignore\nrepeated_assert::that(10, Duration::from_millis(50), || {\n    let checksum = crc(\"should_appear_soon.txt\");\n    assert_eq!(checksum, 1234);\n});\n```\n\nReturn result\n\n```rust,ignore\nrepeated_assert::that(10, Duration::from_millis(50), || -\u003e Result\u003c_, Box\u003cdyn std::error::Error\u003e\u003e {\n    let checksum = crc(\"should_appear_soon.txt\")?;\n    assert_eq!(checksum, 1234);\n})?;\n```\n\nAsync\n\n```rust,ignore\nrepeated_assert::that_async(10, Duration::from_millis(50), || async {\n    let status = query_db().await;\n    assert_eq!(status, \"success\");\n}).await;\n```\n\n## Catch failing tests\n\nIt's also possible to \"catch\" failing tests by executing some code if the expressions couldn't be asserted in order to trigger an alternate strategy.\nThis can be useful if the tested program relies on an unreliable service.\nThis counters the idea of a test to some degree, so use it only if the unreliable service is not critical for your program.\n\nPoke unreliable service after 5 unsuccessful assertion attempts\n\n```rust,ignore\nrepeated_assert::with_catch(10, Duration::from_millis(50), 5,\n    || {\n        // poke unreliable service\n    },\n    || {\n        assert!(Path::new(\"should_appear_soon.txt\").exists());\n    }\n);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfaust%2Frepeated-assert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdfaust%2Frepeated-assert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfaust%2Frepeated-assert/lists"}