diff --git a/paimon-python/pypaimon/tests/native_hybrid_search_test.py b/paimon-python/pypaimon/tests/native_hybrid_search_test.py index a5bbabfe478b..fef63a2bb406 100644 --- a/paimon-python/pypaimon/tests/native_hybrid_search_test.py +++ b/paimon-python/pypaimon/tests/native_hybrid_search_test.py @@ -202,7 +202,8 @@ def test_one_authoritative_rest_snapshot_for_all_routes_without_retry(rest_catal first = table.snapshot_manager().get_latest_snapshot() indexes._append(table, _rows(8, 4), schema=SCHEMA) if response == 'error': - reply, code = ErrorResponse('TABLE', 'indexes', 'snapshot unavailable', 503), 503 + # 500, not 503: REST clients retry reads on 429 and 503, as Java does. + reply, code = ErrorResponse('TABLE', 'indexes', 'snapshot unavailable', 500), 500 else: reply = (GetTableSnapshotResponse(TableSnapshot(first, 1, 0, 7, first.time_millis)) if response == 'first' else GetTableSnapshotResponse()) diff --git a/paimon-python/pypaimon/tests/native_read_snapshot_test.py b/paimon-python/pypaimon/tests/native_read_snapshot_test.py index 74370736d73b..dcb70a15a7a7 100644 --- a/paimon-python/pypaimon/tests/native_read_snapshot_test.py +++ b/paimon-python/pypaimon/tests/native_read_snapshot_test.py @@ -193,9 +193,10 @@ def test_rest_snapshot_response_is_authoritative_without_search_retry(rest_catal from pypaimon.api.api_response import ErrorResponse, GetTableSnapshotResponse catalog, server = rest_catalog table = hybrid._table(catalog) + # 500, not 503: REST clients retry reads on 429 and 503, as Java does. reply = GetTableSnapshotResponse() if response == 'empty' else ErrorResponse( - 'TABLE', 'indexes', 'snapshot unavailable', 503) - code = 200 if response == 'empty' else 503 + 'TABLE', 'indexes', 'snapshot unavailable', 500) + code = 200 if response == 'empty' else 500 with patch.object(server, '_table_snapshot_handle', return_value=server._mock_response(reply, code)) as latest: with _native_only(): if response == 'error':