forked from mtusi2026/mtusi2026lab5
31 lines
1.7 KiB
Plaintext
31 lines
1.7 KiB
Plaintext
Command:
|
|
python -m unittest discover -s student-tests
|
|
|
|
Result:
|
|
PASS (23 tests)
|
|
|
|
Fault-injection coverage:
|
|
- Triggered the production child-exit failpoint before and after the original S3 write
|
|
(the test substitutes os._exit with a sentinel exception to inspect resulting state).
|
|
- Verified retry is scheduled with the next attempt number.
|
|
- Verified stale first-attempt redelivery does not create side effects.
|
|
- Verified retry uses deterministic object keys and reaches ready.
|
|
- Verified duplicate delivery after ready does not overwrite objects.
|
|
- Verified a v1 event cannot process or overwrite a v2 job; the v2 event completes.
|
|
- Verified pipeline versions use distinct, fixed encoding qualities.
|
|
- Verified staging cleanup ignores processing jobs and is idempotent for ready jobs.
|
|
- Verified publisher marks outbox published only after confirm; publish failure remains retryable.
|
|
- Verified expired leases enqueue the next attempt.
|
|
- Verified replay is limited to failed attachments and writes operator audit/outbox intent.
|
|
- Verified permanent failures and exhausted retries are registered and routed to the failed event.
|
|
|
|
Scope:
|
|
The tests exercise production worker functions with in-memory PostgreSQL/S3 adapters.
|
|
Live Docker/PostgreSQL/S3/RabbitMQ crash scenarios were also verified; see
|
|
evidence/live-runtime.txt for the exact scenarios and observed states.
|
|
|
|
Invariants:
|
|
- HTTP-accepted jobs have staging, job, and outbox intent committed atomically (see evidence/outbox.txt).
|
|
- The worker acknowledges only after a ready/failed state or a retry outbox event is committed.
|
|
- Delivery is at-least-once, not exactly-once; deterministic keys and version/attempt fences make repeats safe.
|