Scénario de test & Cas d'usage
A small data table is created. The focus of this scenario is on session states and action parameters, not on data processing.
| 1 | DATA casuser.trade_data; |
| 2 | DO i = 1 to 10; |
| 3 | trade_id = i; |
| 4 | value = 1000 * i; |
| 5 | OUTPUT; |
| 6 | END; |
| 7 | RUN; |
| 1 | |
| 2 | PROC CAS; |
| 3 | ACTION |
| 4 | SESSION.batchresults / uuid='this-is-not-a-real-uuid'; |
| 5 | RUN; |
| 6 |
| 1 | cas risk_session name='risk_session'; |
| 2 | cas admin_session; |
| 3 | PROC CAS; |
| 4 | SESSION admin_session; |
| 5 | s_uuid = findSession('risk_session'); |
| 6 | ACTION SESSION.batchresults / uuid=s_uuid; |
| 7 | RUN; |
| 1 | PROC CAS; |
| 2 | SESSION risk_session; |
| 3 | ACTION BUILTINS.echo RESULT=r / message='hello', async='fast_job'; |
| 4 | RUN; |
| 5 | PROC CAS; |
| 6 | SESSION admin_session; |
| 7 | s_uuid = findSession('risk_session'); |
| 8 | /* This creates a race condition */ |
| 9 | ACTION SESSION.batchresults / uuid=s_uuid; |
| 10 | RUN; |
| 1 | PROC CAS; |
| 2 | SESSION risk_session; |
| 3 | ACTION SESSION.actionstatus / name='fast_job'; |
| 4 | RUN; |
Each test case should fail gracefully without crashing the server. Test Case A should produce an error in the log stating the session UUID was not found. Test Case B should result in an error indicating no running action is available to be switched to batch mode in the target session. Test Case C will most likely produce the same error as B, because the 'fast_job' completes almost instantly, leaving no 'running' action for `batchresults` to act upon. The system must remain stable throughout all invalid calls.