Skip to content

Commit

Permalink
tests(correlation-id): fix flaky test (#14176)
Browse files Browse the repository at this point in the history
KAG-6207

(cherry picked from commit dbc9e8a)
  • Loading branch information
ADD-SP authored and github-actions[bot] committed Jan 24, 2025
1 parent e38c06b commit f9c353d
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions spec/03-plugins/11-correlation-id/02-schema_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ describe("Plugin: correlation-id (schema) #a [#" .. strategy .."]", function()
},
}
local sql = render([[
UPDATE plugins SET route_id='$(ROUTE_ID)',
protocols=ARRAY['grpc','grpcs','http','https'],
cache_key='$(CACHE_KEY)'
UPDATE plugins SET route_id='$(ROUTE_ID)',
protocols=ARRAY['grpc','grpcs','http','https'],
cache_key='$(CACHE_KEY)'
WHERE id='$(ID)';
COMMIT;
]], {
Expand Down Expand Up @@ -174,16 +174,19 @@ describe("Plugin: correlation-id (schema) #a [#" .. strategy .."]", function()
assert.equals("uuid#counter", res.config.generator)

local proxy_client = helpers.proxy_client(20000, 9002, "127.0.0.1")
res = assert(proxy_client:send {
method = "GET",
path = "/",
headers = {
["Host"] = "example.com",
}
})
assert.res_status(200, res)
assert.is_not_nil(res.headers["Kong-Request-ID"])
helpers.pwait_until(function()
res = assert(proxy_client:send {
method = "GET",
path = "/",
headers = {
["Host"] = "example.com",
}
})
assert.res_status(200, res)
assert.is_not_nil(res.headers["Kong-Request-ID"])
end, 10)
proxy_client:close()

end)
end)
end -- for inc_sync
Expand Down

0 comments on commit f9c353d

Please sign in to comment.