Skip to content

Commit

Permalink
tests(correlation-id): fix flaky test (#14176)
Browse files Browse the repository at this point in the history
  • Loading branch information
ADD-SP authored Jan 17, 2025
1 parent 902e16a commit dbc9e8a
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 rpc_sync
Expand Down

1 comment on commit dbc9e8a

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bazel Build

Docker image available kong/kong-dev:dbc9e8a730aab282bad90a453d1a10162f1220b5
Artifacts available https://github.com/Kong/kong/actions/runs/12821301860

Please sign in to comment.