Fault injection and testing core
Project description
faultcore
High-performance fault injection and network simulation for Python, backed by Rust.
Overview
faultcore provides Python decorators and policy management for:
- network timeouts (
timeout); - bandwidth throttling (
rate); - latency, jitter, packet loss, and burst loss;
FaultOSI: OSI-pragmatic L1..L7 fault pipeline infaultcore_network;- transparent socket interception on Linux via
faultcore run.
Detailed documentation lives in docs/.
Quick Start
Requirements:
- Python 3.10+
- Rust toolchain
- Linux for network interception
Install development dependencies and build native artifacts:
uv sync --group dev
./build.sh
build.sh expects .venv/bin/python to exist, validates version alignment across
pyproject.toml, faultcore_interceptor/Cargo.toml, and faultcore_network/Cargo.toml,
then stages Linux interceptor artifacts into src/faultcore/_native/<platform-tag>/ before building wheels.
Fast validation path:
sh lint.sh
sh build.sh
sh tests.sh
Long stress path (optional):
sh tests_long.sh
CLI-first execution:
uv run faultcore doctor
uv run faultcore run -- python -c "import socket; print('ok')"
uv run faultcore run --run-json artifacts/run.json -- pytest -q
uv run faultcore report --input artifacts/run.json --output artifacts/report.html
uv run faultcore report --input artifacts/run.json --output artifacts/report.latest.html --max-events 200 --reverse-events
Notes:
faultcore rundefaults to strict mode on Linux and exits with code2when interceptor probing fails.- Use
--no-strictonly for debugging environments where preload activation is intentionally unavailable. - With
--run-json, CLI enables record/replay capture mode automatically when mode is unset/off and writes<run-json>.rr.jsonl.gzwhenFAULTCORE_RECORD_REPLAY_PATHis unset. faultcore reportsupports optional event rendering controls:--max-eventsand--reverse-events.
Manual LD_PRELOAD execution is still available for advanced debugging.
Platform behavior:
- Linux:
faultcore runconfiguresLD_PRELOADautomatically and probes interceptor activation in strict mode. - Non-Linux: decorators and policy APIs are still callable, but interceptor-level network effects are not active.
Minimal usage:
import faultcore
@faultcore.timeout(connect="200ms")
def slow_operation():
return "ok"
@faultcore.rate("10mbps")
def network_operation():
return "ok"
Documentation Index
Primary docs entrypoint:
Core documentation paths:
| Document | Scope |
|---|---|
docs/getting_started.md |
Installation, first run, first decorator |
docs/cli_usage.md |
CLI commands (doctor, run, report) and recommended workflows |
docs/api_reference.md |
Feature-by-feature reference (timeout, rate, latency, jitter, loss, DNS, policy APIs) |
docs/examples.md |
Scenario map and recommended testing patterns |
docs/troubleshooting.md |
Symptom-based troubleshooting and quality gate |
Deep-dive references:
| Document | Scope |
|---|---|
docs/architecture.md |
System architecture with module layout and FaultOSI |
docs/policies_and_context.md |
Policy lifecycle and application patterns |
docs/interceptor_and_shm.md |
CLI runtime and SHM/interceptor details |
docs/testing_and_examples.md |
Build/test command details and legacy examples |
docs/shm_protocol.md |
SHM binary layout and consistency protocol |
docs/operations_tuning.md |
Baseline/tuning/stress operational guidance |
Build Documentation (Sphinx + MyST)
Generate HTML docs locally:
uv run sphinx-build -M html docs docs/_build
Open generated site entrypoint:
docs/_build/html/index.html
Publish to PyPI
The project includes a release workflow at .github/workflows/publish-pypi.yml that builds:
- Linux
x86_64wheels - Linux
i686wheels - Linux
aarch64wheels - one source distribution (
sdist)
Release options:
- Push a tag like
v2026.3.8to publish directly to PyPI. - Run the workflow manually (
workflow_dispatch) and choose:pypifor production publishtestpypifor dry-run validation
The wheel build uses cibuildwheel and stages architecture-specific native artifacts with
scripts/build_native_artifacts.sh before each wheel build.
Project Status
- Python package metadata:
pyproject.toml - Public API source of truth:
src/faultcore/__init__.py - Decorator behavior source of truth:
src/faultcore/decorator.py - Unit tests:
tests/unit/ - Integration CLI scripts:
tests/integration/
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file faultcore-2026.3.28.tar.gz.
File metadata
- Download URL: faultcore-2026.3.28.tar.gz
- Upload date:
- Size: 46.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd1f3a48fbe4ea59d69a63f42f3fd08afee53508d0110d0d0ad2cc836fd83d3b
|
|
| MD5 |
19536df57784023ba36b850b32a41160
|
|
| BLAKE2b-256 |
ffefed6d55a2445b7d519938827eed721d3473d1a491ed9eadeb042b589d3ffe
|
Provenance
The following attestation bundles were made for faultcore-2026.3.28.tar.gz:
Publisher:
publish-pypi.yml on albertobadia/faultcore
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
faultcore-2026.3.28.tar.gz -
Subject digest:
fd1f3a48fbe4ea59d69a63f42f3fd08afee53508d0110d0d0ad2cc836fd83d3b - Sigstore transparency entry: 1191882764
- Sigstore integration time:
-
Permalink:
albertobadia/faultcore@f102306cbd3679fb4579529d4f134454a09df172 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/albertobadia
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@f102306cbd3679fb4579529d4f134454a09df172 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file faultcore-2026.3.28-py3-none-manylinux2014_x86_64.whl.
File metadata
- Download URL: faultcore-2026.3.28-py3-none-manylinux2014_x86_64.whl
- Upload date:
- Size: 476.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0091c10f2ee62625ab27f515c4297dad2197d3528d91993a08c8efdba78b272e
|
|
| MD5 |
fc17ad3baa1a771d3a45d41278e82d6e
|
|
| BLAKE2b-256 |
86bf67236976c0dd7d3bf70242d45d15d151c8ed9e6c3a6bc22c9f9fb15423db
|
Provenance
The following attestation bundles were made for faultcore-2026.3.28-py3-none-manylinux2014_x86_64.whl:
Publisher:
publish-pypi.yml on albertobadia/faultcore
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
faultcore-2026.3.28-py3-none-manylinux2014_x86_64.whl -
Subject digest:
0091c10f2ee62625ab27f515c4297dad2197d3528d91993a08c8efdba78b272e - Sigstore transparency entry: 1191882766
- Sigstore integration time:
-
Permalink:
albertobadia/faultcore@f102306cbd3679fb4579529d4f134454a09df172 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/albertobadia
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@f102306cbd3679fb4579529d4f134454a09df172 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file faultcore-2026.3.28-py3-none-manylinux2014_i686.whl.
File metadata
- Download URL: faultcore-2026.3.28-py3-none-manylinux2014_i686.whl
- Upload date:
- Size: 514.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03dda57c85c4690416ab06009b5cf39f05dfde198717d52155fd44dc6faa25f5
|
|
| MD5 |
ff2a92d9c4e052372e5f1d7f846db96d
|
|
| BLAKE2b-256 |
e97f6267faaabb6c54cb3bbf3fed0b520e2f64c245e6a32fb23153edae3bc546
|
Provenance
The following attestation bundles were made for faultcore-2026.3.28-py3-none-manylinux2014_i686.whl:
Publisher:
publish-pypi.yml on albertobadia/faultcore
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
faultcore-2026.3.28-py3-none-manylinux2014_i686.whl -
Subject digest:
03dda57c85c4690416ab06009b5cf39f05dfde198717d52155fd44dc6faa25f5 - Sigstore transparency entry: 1191882767
- Sigstore integration time:
-
Permalink:
albertobadia/faultcore@f102306cbd3679fb4579529d4f134454a09df172 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/albertobadia
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@f102306cbd3679fb4579529d4f134454a09df172 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file faultcore-2026.3.28-py3-none-manylinux2014_aarch64.whl.
File metadata
- Download URL: faultcore-2026.3.28-py3-none-manylinux2014_aarch64.whl
- Upload date:
- Size: 465.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62a8ebc32a1398791b557c026269f6ab69ea5a40ded10b919fa6ef3fd828f71b
|
|
| MD5 |
b9d3acb018204aa839e8121fba498fba
|
|
| BLAKE2b-256 |
d61d314ba6795122b7dfa151d87754f291d8f9ba2c0665c7d58482c663e8d3e9
|
Provenance
The following attestation bundles were made for faultcore-2026.3.28-py3-none-manylinux2014_aarch64.whl:
Publisher:
publish-pypi.yml on albertobadia/faultcore
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
faultcore-2026.3.28-py3-none-manylinux2014_aarch64.whl -
Subject digest:
62a8ebc32a1398791b557c026269f6ab69ea5a40ded10b919fa6ef3fd828f71b - Sigstore transparency entry: 1191882765
- Sigstore integration time:
-
Permalink:
albertobadia/faultcore@f102306cbd3679fb4579529d4f134454a09df172 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/albertobadia
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@f102306cbd3679fb4579529d4f134454a09df172 -
Trigger Event:
workflow_dispatch
-
Statement type: