-
-
Notifications
You must be signed in to change notification settings - Fork 31.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test_capi fails if run with --forever
argument
#105273
Comments
Seems to be introduced in #105100 |
Fixed by #105683 |
I am testing heads/main: 6a80664 and the issue happens again. ./python -m test -R 3:3 -v test_capi -m test_long_loop -m test_counter_optimizer
0:00:00 load avg: 0.62 Run tests sequentially
0:00:00 load avg: 0.62 [1/1] test_capi
beginning 6 repetitions
123456
test_counter_optimizer (test.test_capi.test_misc.TestOptimizerAPI.test_counter_optimizer) ... ok
test_long_loop (test.test_capi.test_misc.TestOptimizerAPI.test_long_loop)
Check that we aren't confused by EXTENDED_ARG ... ok
----------------------------------------------------------------------
Ran 2 tests in 0.001s
OK
.test_counter_optimizer (test.test_capi.test_misc.TestOptimizerAPI.test_counter_optimizer) ... FAIL
test_long_loop (test.test_capi.test_misc.TestOptimizerAPI.test_long_loop)
Check that we aren't confused by EXTENDED_ARG ... FAIL
======================================================================
FAIL: test_counter_optimizer (test.test_capi.test_misc.TestOptimizerAPI.test_counter_optimizer)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/xxx/cpython/Lib/test/test_capi/test_misc.py", line 2386, in test_counter_optimizer
self.assertEqual(opt.get_count(), 1000)
AssertionError: 0 != 1000
======================================================================
FAIL: test_long_loop (test.test_capi.test_misc.TestOptimizerAPI.test_long_loop)
Check that we aren't confused by EXTENDED_ARG
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/xxx/cpython/Lib/test/test_capi/test_misc.py", line 2408, in test_long_loop
self.assertEqual(opt.get_count(), 10)
AssertionError: 0 != 10
----------------------------------------------------------------------
Ran 2 tests in 0.002s
FAILED (failures=2)
test test_capi failed
test_capi failed (2 failures)
== Tests result: FAILURE ==
1 test failed:
test_capi
Total duration: 76 ms
Tests result: FAILURE
|
Unfortunately not. |
Just got hit by this (it makes the refleak buildbots fail in #105924). I've got a hunch the problem is in deopt_code() (in codeobject.c), but I can't quite nail it. I put a printf() there when opcode == ENTER_EXECUTOR, and in the loop in the test which executes five times, it prints only four times?! Then the second time the whole test is re-run, it prints never at all (but the test fails after the first time through the loop). It appears the first iteration (out of five in the test -- Not sure where this really points, but the logic in deopt_code() is subtle (it gets the opcode from |
This was now fixed by @vstinner in #106171. His fix is to create a whole new function object (by using (I tried putting the assignment to Arguably we ought to have an explicit API for this, but that can wait. |
Tried on current main:
Fails on test_capi/test_misc/TestOptimizerAPI.test_counter_optimizer
The text was updated successfully, but these errors were encountered: