-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix intermittent test failure on AppVeyor #5447
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
Conversation
For several days this test case is often failing on AppVeyor, because the table already exists. Thus, we add a cleanup step just before creating the table.
Maybe try enabling printing of all tests (not just SKIP) so we see what runs before it? Just looking at alphabetical order of tests, I really don't see what would cause this. The preceding test mysqli_insert_id_variation.phpt does not use the test table, and the one before that mysqli_insert_id.phpt uses the test table, but includes |
That looks like the most promising approach. Done as 51dfba3. |
I was just about to open a PR which attempts to fix the same problem, and then saw this... ...Let me open it anyhow, and you can look at it and see if it looks like a worthwhile approach. |
Tests seems to be running in expected order, and the parellel tests are OpenSSL tests, which shouldn't interfere. |
I wonder whether this cleaning fails (for whatever reason); AIUI, this would not be reported by run-tests.php. |
That seems plausible. Maybe we can hack in something to print out the output of CLEAN? |
@nikic, very hacky, but should do for now: run-tests.php | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/run-tests.php b/run-tests.php
index ffdb72a00e..93d84cc73f 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -2497,7 +2497,10 @@ COMMAND $cmd
$clean_params = settings2params($clean_params);
$extra = !IS_WINDOWS ?
"unset REQUEST_METHOD; unset QUERY_STRING; unset PATH_TRANSLATED; unset SCRIPT_FILENAME; unset REQUEST_METHOD;" : "";
- system_with_timeout("$extra $php $pass_options $extra_options -q $clean_params $no_file_cache \"$test_clean\"", $env);
+ $clean_output = system_with_timeout("$extra $php $pass_options $extra_options -q $clean_params $no_file_cache \"$test_clean\"", $env);
+ if (trim($clean_output) != '') {
+ echo "\nCLEAN OUTPUT: $file: $clean_output\n";
+ }
}
if (!$cfg['keep']['clean']) { |
Please see the approach in #5479. |
@alexdowad, that is basically the same approach as this PR + using another name for the table. Actually, neither should be necessary. |
@cmb69 Let's temporarily land the run-tests patch and see if anything turns up. |
This is a hack to investigate why mysqli_insert_packet_overflow.phpt intermittently fails on AppVeyor, and will be reverted in due time. See <#5447 (comment)>.
Done as 5eb4ab0. |
OK. Thanks for reviewing. |
@alexdowad, to be clear, I'd prefer your PR over this one, but still like to fix the root cause of the test failure. |
Nope, apparently no issues with the former cleanups: https://ci.appveyor.com/project/php/php-src/builds/32504539/job/6eq2d84d1o8auhlx?fullLog=true#L11242 |
Ahem. AppVeyor test environment: Environment: THREAD_SAFE=1, OPCACHE=1, PARALLEL=-j2, INTRINSICS=AVX Do you see that Deleting |
@alexdowad All tests using MySQL declare |
Thanks. I learned something here. |
The ini handling code in run-tests is pretty hard to follow, but could it be that the opcache cache_id for Windows is not getting passed down to the clean invocation? |
So yes, it looks like we're only passing the ini overrides for the clean command, not anything else. I don't quite remember what exactly goes wrong if we share opcache instances across parallel jobs, is it plausible that the cleanup script crashes in that case? |
@nikic, ah, good catch! We must not share OPcache instances between processes with different memory layout, but a different set of loaded extensions may easily cause different memory layout. I'll see to it that the worker ID is passed to the clean up scripts. |
From https://ci.appveyor.com/project/php/php-src/builds/32519626/job/1cykafd58wy6hpbi?fullLog=true:
This is missing the "Cleaned successfully" output on the mysqli_insert_id.phpt test, so it does indeed look like the clean script is crashing. Hopefully it's the opcache cache_id and not something else. |
Congratulations! This was a tricky one! |
Yes, that was indeed a tricky one. Thanks @nikic! |
For several days this test case is often failing on AppVeyor, because
the table already exists. Thus, we add a cleanup step just before
creating the table.
I have no idea why this test suddenly started to fail that often. It seems that only happens on master, and might be caused by enabling JIT, although I can't see why that would cause just this test to fail. This fix is not nice; actually it's more a hacky workaround. I'm also not sure what to do with the error message numbering.