This is an automated email from the ASF dual-hosted git repository.

moonming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git


The following commit(s) were added to refs/heads/master by this push:
     new 8b25c370c3 test(inspect): verify JIT recovery without timing 
comparisons (#14102)
8b25c370c3 is described below

commit 8b25c370c302bf33fa1a22bffc3cfef44115c05d
Author: AlinsRan <[email protected]>
AuthorDate: Wed Nov 11 11:04:04 2026 +0800

    test(inspect): verify JIT recovery without timing comparisons (#14102)
---
 t/plugin/inspect.t | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/t/plugin/inspect.t b/t/plugin/inspect.t
index 56f56d83ae..faecc5208b 100644
--- a/t/plugin/inspect.t
+++ b/t/plugin/inspect.t
@@ -536,7 +536,9 @@ inspect: all hooks removed
         content_by_lua_block {
             local test = require("lib.test_inspect")
 
-            local t1 = test.hot1()
+            local dbg = require("apisix.inspect.dbg")
+            assert(jit.status(), "JIT should be enabled before installing the 
hook")
+            test.hot1()
 
             write_hooks([[
             local test = require("lib.test_inspect")
@@ -546,10 +548,21 @@ inspect: all hooks removed
             end)
             ]])
 
-            ngx.sleep(1.5)
+            -- Wait for the file watcher to install the hook before exercising 
it.
+            for _ = 1, 50 do
+                if #dbg.hooks() == 1 then
+                    break
+                end
+                ngx.sleep(0.1)
+            end
+            assert(#dbg.hooks() == 1, "inspect hook was not installed")
+            assert(not jit.status(), "JIT should be disabled while the hook is 
active")
 
-            local t2 = test.hot1()
-            assert(t2-t1 < t1*0.8, "hot1 consumes at least double times than 
before")
+            test.hot1()
+
+            assert(#dbg.hooks() == 0, "completed hook should be removed")
+            assert(debug.gethook() == nil, "debug hook should be cleared")
+            assert(jit.status(), "JIT should be restored after the last hook 
completes")
         }
     }
 --- error_log

Reply via email to