test: add TDD bug-capture test for #993 — server_connect non-atomic writes #1128
No reviewers
Labels
No labels
auto/needs-reevaluation
controller-managed
auto/blocked-by-deps
auto/ci-timeout
auto/claimed-implementer
auto/claimed-merge
auto/claimed-reviewer
auto/driver-down
auto/invariant-violation
auto/last-attempt-tier-0
auto/last-attempt-tier-1
auto/last-attempt-tier-2
auto/last-attempt-tier-min
Automation Tracking
auto/needs-conflict-resolution
auto/needs-implementer
auto/postmortem
auto/ready-to-merge
auto/restart-throttled
auto/revert
auto/sentinel
auto/stale-inactivity
auto/unstable
Blocked
Bounty
$100
Bounty
$1000
Bounty
$10000
Bounty
$20
Bounty
$2000
Bounty
$250
Bounty
$50
Bounty
$500
Bounty
$5000
Bounty
$750
MoSCoW
Could have
MoSCoW
Must have
MoSCoW
Should have
Needs Feedback
Points
1
Points
13
Points
2
Points
21
Points
3
Points
34
Points
5
Points
55
Points
8
Points
88
Priority
Backlog
Priority
CI Blocker
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Signed-off: Owner
Signed-off: Scrum Master
Signed-off: Tech Lead
Spike
State
Completed
State
Duplicate
State
In Progress
State
In Review
State
Paused
State
Unverified
State
Verified
State
Wont Do
Type
Automation
Type
Bug
Type
Discussion
Type
Documentation
Type
Epic
Type
Feature
Type
Legendary
Type
Refactor
Type
Support
Type
Task
Type
Testing
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
cleveragents/cleveragents-core!1128
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "tdd/m6-server-connect-non-atomic"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Add TDD bug-capture Behave tests that prove bug #993 exists:
server_connect()inserver.pywrites three config values (server.url,server.namespace,server.tls-verify) via sequentialset_value()calls with no atomicity guarantee. When a middle call fails, earlier values are already persisted, leaving the config in a half-written state.Changes
features/tdd_server_connect_atomic_writes.feature— 3 scenarios tagged@tdd_expected_fail @tdd_bug @tdd_bug_993features/steps/tdd_server_connect_atomic_writes_steps.py— Uses a_FailingConfigServicesubclass that raisesOSErroron a configurableset_value()call to simulate disk/permission failuresScenarios
server_connectwhereset_valuefails on the 2nd call (server.namespace). Asserts error was raised and all three values are rolled back. ASSERT FAILS:server.urlretains the new value.server.tls-verify). Asserts error was raised and bothserver.urlandserver.namespaceare rolled back to original values. ASSERT FAILS: both retain new values.server.urlpersisted. ASSERT FAILS:server.urlwas persisted despite the subsequent failure.All assertions fail (proving the bug exists), and
@tdd_expected_failinverts these to CI passes.Review Fixes Applied
@thendecorator in step definitions).import tomllibto top-level imports: Was previously buried inside_read_flat_config()function body, violating CONTRIBUTING.md § Import Guidelines. Now at top of file alongside other stdlib imports._cleanuphandler instep_fresh_config_dirnow callsshutil.rmtree()on the temporary directory to prevent/tmp/tdd993_*accumulation over CI runs.@then("an error should have been raised during server_connect")step verifiescontext.atomic_error is not Nonebefore config-checking steps, guarding against silent exception swallowing.Quality Gates
nox -s lintnox -s typechecknox -s unit_testsnox -s integration_testsnox -s coverage_reportRobot Integration Test
N/A — The non-atomic write behavior is internal to
server_connectandConfigService.set_value(). No external system integration is involved.Closes #1097
8ec20837c0231ed59ad2Review: APPROVED
TDD tags correct (
@tdd_bug @tdd_bug_993 @tdd_expected_fail). Behave steps fully implemented for server_connect non-atomic writes bug.Note
Missing Robot Framework integration tests. For consistency with other TDD PRs, consider adding a
.robotfile + helper script in a follow-up.New commits pushed, approval review dismissed automatically according to repository settings