| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- @echo off
- REM ============================================================
- REM UppPay timeout threshold experiment
- REM Reproduces HttpServices.cs Post() against a deliberately slow
- REM server so the real client-side timeout can be measured.
- REM
- REM Scenario A server stalls 200s, client sets NO Timeout
- REM -> expect failure at ~100 s (.NET default)
- REM Scenario B server stalls 200s, client sets Timeout=30 s
- REM -> expect failure at ~30 s
- REM Scenario C server answers 504 after 3 s
- REM -> expect ProtocolError, NOT Timeout
- REM
- REM Scenario C proves a proxy 504 can never produce the message
- REM "The operation has timed out" that appears in the real log.
- REM ============================================================
- setlocal
- set TOOLS=%~dp0
- echo ============================================================
- echo UppPay timeout threshold experiment
- echo workdir: %TOOLS%
- echo ============================================================
- echo.
- REM ---------- Scenario A : no Timeout (current production behaviour)
- echo [A] server stalls 200 s, client Timeout NOT set ...
- start "slow8099" /min "%PYEXE%" "%TOOLS%slow_server.py" 200 8099
- timeout /t 2 /nobreak >nul
- powershell -NoProfile -ExecutionPolicy Bypass -File "%TOOLS%timeout_probe.ps1" -Url "http://127.0.0.1:8099/"
- echo.
- REM ---------- Scenario B : Timeout = 30 s
- echo [B] server stalls 200 s, client Timeout = 30 s ...
- start "slow8098" /min "%PYEXE%" "%TOOLS%slow_server.py" 200 8098
- timeout /t 2 /nobreak >nul
- powershell -NoProfile -ExecutionPolicy Bypass -File "%TOOLS%timeout_probe.ps1" -Url "http://127.0.0.1:8098/" -TimeoutMs 30000
- echo.
- REM ---------- Scenario C : proxy answers 504
- echo [C] proxy answers 504 after 3 s ...
- start "gw8097" /min "%PYEXE%" "%TOOLS%gw_504_server.py" 3 8097
- timeout /t 2 /nobreak >nul
- powershell -NoProfile -ExecutionPolicy Bypass -File "%TOOLS%timeout_probe.ps1" -Url "http://127.0.0.1:8097/" -TimeoutMs 60000
- echo.
- echo ============================================================
- echo RESULT SUMMARY
- echo ------------------------------------------------------------
- echo A no Timeout -> fails at ~100 s (Status=Timeout)
- echo B Timeout=30 s -> fails at ~30 s (Status=Timeout)
- echo C proxy 504 -> fails at ~3 s (Status=ProtocolError)
- echo
- echo The real log message is "The operation has timed out",
- echo which matches A and B, never C. So UppPay is NOT sitting
- echo behind a 504 proxy, and the threshold is 100 s today,
- echo NOT 30 s.
- echo ============================================================
- endlocal
|