]> granicus.if.org Git - php/commitdiff
Add mechanism to skip the skipif cache
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 4 Mar 2021 15:26:47 +0000 (16:26 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 4 Mar 2021 15:28:11 +0000 (16:28 +0100)
If the SKIPIF section return nocache, don't cache the result. This
is used by tests that perform complex test set in conjunction with
skip checks, and need to be evaluated every time.

ext/mysqli/tests/mysqli_pam_sha256.phpt
ext/mysqli/tests/mysqli_pam_sha256_public_key_ini.phpt
ext/mysqli/tests/mysqli_pam_sha256_public_key_option.phpt
ext/mysqli/tests/mysqli_pam_sha256_public_key_option_invalid.phpt
run-tests.php

index 8866409efeb5f6f43c06aaff8c3bcb5a9b9812f4..29df5c1fde5cc592dc6ab41e87ca223e6a71c8db 100644 (file)
@@ -75,6 +75,7 @@ if (!$link->query(sprintf("GRANT SELECT ON TABLE %s.test TO shatest@'%%'", $db))
 }
 
 $link->close();
+echo "nocache";
 ?>
 --FILE--
 <?php
index 86e27fbaff7d9a5fc7f5771eb87a55dc2c805557..90f9a255a6bbfd18ab9500f9dec065802ff3a00d 100644 (file)
@@ -88,6 +88,7 @@ if (!$link->query(sprintf("GRANT SELECT ON TABLE %s.test TO shatest@'%%'", $db))
 }
 
 $link->close();
+echo "nocache";
 ?>
 --INI--
 mysqlnd.sha256_server_public_key="test_sha256_ini"
index 9b5639ff9a7adf19c468f835e7b136472f59286f..1493c377372fcf55fb57a35e40b459a101844a94 100644 (file)
@@ -85,6 +85,7 @@ if (!$link->query(sprintf("GRANT SELECT ON TABLE %s.test TO shatest@'%%'", $db))
 }
 
 $link->close();
+echo "nocache";
 ?>
 --FILE--
 <?php
index b664179265fdd405dc193f2a7fc6c8a576bb68bb..5c55821b8a5d320da937025269581239e296e068 100644 (file)
@@ -85,6 +85,7 @@ if (!$link->query(sprintf("GRANT SELECT ON TABLE %s.test TO shatest@'%%'", $db))
 }
 
 $link->close();
+echo "nocache";
 ?>
 --FILE--
 <?php
index 7a66370c39c1e7c4d6b126a75e26045e386cc702..a44a90bb7c115367ec3aa879fee840074a9c22e2 100755 (executable)
@@ -3749,7 +3749,9 @@ class SkipCache
 
         save_text($checkFile, $code, $tempFile);
         $result = trim(system_with_timeout("$php \"$checkFile\"", $env));
-        $this->skips[$key][$code] = $result;
+        if (strpos($result, 'nocache') === false) {
+            $this->skips[$key][$code] = $result;
+        }
         $this->misses++;
 
         if (!$this->keepFile) {