{"id":28762432,"url":"https://github.com/rubrikinc/sysfail","last_synced_at":"2025-06-26T07:02:08.893Z","repository":{"id":262962591,"uuid":"883065864","full_name":"rubrikinc/sysfail","owner":"rubrikinc","description":"A shared library to help test your code with failure-injection","archived":false,"fork":false,"pushed_at":"2025-01-28T00:37:46.000Z","size":173,"stargazers_count":1,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-17T08:08:34.085Z","etag":null,"topics":["checkpointing","failure-injection","failure-injection-testing","idempotency","progress","resilience-testing","resumability","stateful-app"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rubrikinc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2024-11-04T10:14:37.000Z","updated_at":"2025-01-28T00:37:50.000Z","dependencies_parsed_at":"2025-01-25T04:29:08.047Z","dependency_job_id":null,"html_url":"https://github.com/rubrikinc/sysfail","commit_stats":null,"previous_names":["rubrikinc/sysfail"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rubrikinc/sysfail","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubrikinc%2Fsysfail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubrikinc%2Fsysfail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubrikinc%2Fsysfail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubrikinc%2Fsysfail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rubrikinc","download_url":"https://codeload.github.com/rubrikinc/sysfail/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubrikinc%2Fsysfail/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262018669,"owners_count":23245618,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["checkpointing","failure-injection","failure-injection-testing","idempotency","progress","resilience-testing","resumability","stateful-app"],"created_at":"2025-06-17T08:08:33.469Z","updated_at":"2025-06-26T07:02:08.873Z","avatar_url":"https://github.com/rubrikinc.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"Sysfail is a shared library that helps test applications with failure-injection.\n\n## Overview\n\nAutomated testing is key to building high quality software. Most modern\nsoftware depends on external services or processes such as databases, queues,\ncaches etc in addition to other stateful components like filesystems and\ndevices.\nSystem-calls are the common interface that userland applications use to talk to\nother processes / services and to the operating-system itself which makes them\na powerful abstraction for testing applications' failure-resilience and\nrobustness.\nSysfail helps declaratively expose application (system under test) to failures\nand delays and helps harden non-functional properties such as idempotency,\ncheckpoint-recovery, retries / ability to make progress in the face of\ndegradation / errors etc.\n\n## Features\n\n* Inject failures and / or delay to any system-call of choice\n* Specify mix-of / weights-for errors that are presented in response to failure\n* Fine grained control on threads that are failure-injected\n* Specify fraction of errors that are injected before and / or after the syscall\n* Modern C++23 interface\n* C API that also serves as foreign-function-interface (FFI) for other languages (eg. Golang)\n* Ability to failure-inject regardless of extent of control on the actual call-site (eg. 3rd-party libraries)\n\n## Limitations\n\n* At the moment Sysfail only supports Linux + x86_64 / amd64 platform. [^1]\n* While ABI for use over FFI-bridge exists, it does not yet have idomatic\n  wrappers for other languages. [^1]\n* It makes use of [syscall-user-dispatch (aka SUD)](https://github.com/torvalds/linux/blob/master/Documentation/admin-guide/syscall-user-dispatch.rst),\n  so requires Linux version 5.11 or higher.\n* `libc` sometimes quiesces all signal-handlers (which SUD uses) for brief\n  periods (eg. while creating new threads). Sysfail disables failure injection\n  in such cases to avoid breaking `libc`'s assumptions\n* Some syscalls such as `SYS_rt_sigprocmask` are never failure-injected because\n  this would break `libc` code-paths such as the one described above.\n\n[^1]: Patches are most welcome!\n\n## Install\n\nSysfail needs g++, libtbb-dev and libgtest-dev.\n\n```\n$ git clone https://github.com/rubrikinc/sysfail\n$ cd sysfail\n$ mkdir build\n$ cd build\n$ cmake ..\n$ make\n$ make install\n```\n\nOR\n\n```\n$ git clone https://github.com/rubrikinc/sysfail\n$ docker build -t sysfail:test .\n```\nwhich creates a local ubuntu image with sysfail installed. Feel free to modify\nDockerfile to your liking (eg. preferred base-image, install location etc).\n\nOnce built, `run` to play with sysfail in the container\n```\n$ docker run -it sysfail:test /bin/bash\n# make\n...\n```\nor build and test with it, like so\n```\n...\n# su - ubuntu\n$ g++ -o flaky_print flaky_print.cc -lsysfail\n```\n(`flaky_print.cc` should already be present)\n\n\n## Using sysfail\n\nThe headers `sysfail.hh` and `sysfail.h` contain fully documented API for C++\nand C respectively. Linker flag `-lsysfail` links with the library.\n\nTest files `session_test.cc` and `cwrapper_test.cc` serve as working examples of\nusage in C++ and C. `ffi.go` uses FFI (foreign-function-interface) in a\nstandalone-process form-factor, so can serve as a working example for non C / C++\nprojects.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubrikinc%2Fsysfail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubrikinc%2Fsysfail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubrikinc%2Fsysfail/lists"}