You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(server): tighten RI exchange reservation tests; decide audit row for refused reservations #666
Three non-blocking notes from the independent review of PR #662 (go#41 adapter), deliberately left unfixed to avoid restarting the review gate.
Current behaviour
TestConfigExchangeStoreAdapterReserveRIExchange mock (internal/server/handler_ri_exchange_test.go, ~204-209) ignores dailyCapUSD/perExchangeCapUSD, so swapped arguments would pass.
handler_ri_exchange_reservation_integration_test.go sets RIExchangeMaxDailyUSD: baseline + 1000 via a float baseline; a fractional-micro baseline could floor the cap to 999.999999 and break the "1000.000000" assertions. Also, with baseline 0 the standalone daily and per-exchange caps are equal, so either could bind.
A cap-rejected reservation now writes no failed audit row (pkg exchange/auto.go ~525-528); the unit test expects 0 failed rows. Decide whether an audit trail for refused reservations is wanted.
Expected behaviour
Mock asserts the cap strings it receives. 2. Whole-dollar margin above the per-exchange cap (e.g. baseline + 1500) and distinct daily vs per-exchange caps. 3. Explicit decision, documented or implemented.
Proposed fix
Edit the two test files; item 3 may need a pkg change in cloud-commitments-go.
Status update (2026-10-27, checked against main at 7b86e38): Waiting on an owner decision.
Items 1 and 2 (the cap arguments asserted in the adapter test, and distinct whole-dollar daily vs per-exchange caps in the integration test) were fixed by #1282 and are on main. Only item 3 is left: whether a reservation refused by the daily cap should write an RI exchange history row.
Left / blocked on: Item 3 needs an owner decision between options A/B/C from #1282. Not yet numbered as a D-decision.
Verified on origin/main (4707c0a): items 1 and 2 are already on main (a40fba0, #1282); no test change left. Item 3 decision: keep the current behaviour, no failed audit row for a cap-refused reservation (smallest option, no change in cloud-commitments-go). A refusal is the cap working as designed and is already surfaced as an error in the exchange result; a history row would count refusals alongside real attempts. The owner can override by asking for a failed-row write in pkg exchange/auto.go. No commit needed.
Closing without a new commit. Items 1 and 2 are on main in a40fba0 (#1282). Item 3 was decided in the earlier comment: no failed audit row for a cap-refused reservation (needs no migration or table).
Activity
IAmJSD commentedon Oct 23, 2026
Claiming: working on this
test(server): pin RI exchange reservation cap arguments and binding c…
IAmJSD commentedon Oct 27, 2026
Status update (2026-10-27, checked against main at 7b86e38): Waiting on an owner decision.
Items 1 and 2 (the cap arguments asserted in the adapter test, and distinct whole-dollar daily vs per-exchange caps in the integration test) were fixed by #1282 and are on main. Only item 3 is left: whether a reservation refused by the daily cap should write an RI exchange history row.
Left / blocked on: Item 3 needs an owner decision between options A/B/C from #1282. Not yet numbered as a D-decision.
cristim commentedon Nov 12, 2026
Verified on origin/main (4707c0a): items 1 and 2 are already on main (a40fba0, #1282); no test change left. Item 3 decision: keep the current behaviour, no failed audit row for a cap-refused reservation (smallest option, no change in cloud-commitments-go). A refusal is the cap working as designed and is already surfaced as an error in the exchange result; a history row would count refusals alongside real attempts. The owner can override by asking for a failed-row write in pkg exchange/auto.go. No commit needed.
cristim commentedon Nov 13, 2026
Closing without a new commit. Items 1 and 2 are on main in a40fba0 (#1282). Item 3 was decided in the earlier comment: no failed audit row for a cap-refused reservation (needs no migration or table).