MagicStack / MagicStack/asyncpg

Test failure in test_executemany_server_failure_during_writes

オープン
#1,099 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Python
スター
8.1k
フォーク
468
PR マージ指標
30日以内にマージされた PR はありません

説明

  • asyncpg version: 0.29.0
  • PostgreSQL version: 15.4
  • Do you use a PostgreSQL SaaS? If so, which? Can you reproduce
    the issue with a local PostgreSQL install?
    : N/A, building the python-asyncpg package on Fedora Linux infrastructure
  • Python version: 3.12.0
  • Platform: Fedora Linux Rawhide, s390x architecture (only!)
  • Do you use pgbouncer?: No
  • Did you install asyncpg with pip?: No, I am the maintainer of the distribution package.
  • If you built asyncpg locally, which version of Cython did you use?: 0.29.35
  • Can the issue be reproduced under both asyncio and
    uvloop?
    : No, only asyncio. yes

This is new in 0.29.0. I don’t have any idea why it is happening.

I can’t reproduce this with PYTHONASYNCIODEBUG=1, nor can I reproduce it with USE_UVLOOP=1. I have now seen this on x86_64 with asyncio and PYTHONASYNCIODEBUG=1.

I don’t have interactive access to an s390x machine, but I am happy to run experiments or test proposed fixes by submitting package test builds on Fedora infrastructure. For the time being, I plan to simply skip this test on s390x.

=================================== FAILURES ===================================
________ TestExecuteMany.test_executemany_server_failure_during_writes _________
Traceback (most recent call last):
  File "/usr/lib64/python3.12/unittest/case.py", line 58, in testPartExecutor
    yield
  File "/usr/lib64/python3.12/unittest/case.py", line 634, in run
    self._callTestMethod(testMethod)
  File "/usr/lib64/python3.12/unittest/case.py", line 589, in _callTestMethod
    if method() is not None:
       ^^^^^^^^
  File "/builddir/build/BUILDROOT/python-asyncpg-0.29.0-1.fc40.s390x/usr/lib64/python3.12/site-packages/asyncpg/_testbase/__init__.py", line 92, in wrapper
    self.loop.run_until_complete(coro)
  File "/usr/lib64/python3.12/asyncio/base_events.py", line 664, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/asyncpg-0.29.0/tests/test_execute.py", line 215, in test_executemany_server_failure_during_writes
    self.assertLess(pos, 128, 'should stop early')
  File "/usr/lib64/python3.12/unittest/case.py", line 1257, in assertLess
    self.fail(self._formatMessage(msg, standardMsg))
  File "/usr/lib64/python3.12/unittest/case.py", line 715, in fail
    raise self.failureException(msg)
AssertionError: 128 not less than 128 : should stop early

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

tests/test_execute.py から始め、特に 215 行目の失敗しているアサーション付近にある TestExecuteMany.test_executemany_server_failure_during_writes を確認してください。Python 3.12、PostgreSQL 15.4、asyncio を使ってテストを再現し、観測された 128 の位置を、テストが期待する早期停止と比較してください。失敗の原因を理解し、正当な理由のないプラットフォーム固有の skip なしでテストが一貫してパスすれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
postgresql, python
領域
backend, databases
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。