Skip to content

test(elasticsearch-logger): drop the max_pending_entries metadata after the discard test - #13924

Merged
juzhiyuan merged 1 commit into
apache:masterfrom
janiussyafiq:test-logger-metadata-leak
Sep 14, 2026
Merged

juzhiyuan merged 1 commit into
apache:masterfrom
janiussyafiq:test-logger-metadata-leak

Conversation

@janiussyafiq

Copy link
Copy Markdown
Contributor

Description

t/plugin/elasticsearch-logger2.t TEST 8 is flaky in CI. It fails on master and on unrelated PRs since 2026-08-20 (for example this run on master and this one on #13651), and often survives the automatic rerun.

TEST 1 sets plugin metadata max_pending_entries = 1 and never removes it, so etcd keeps it for the rest of the file. Since #13826 the batch processor discards a new entry while one is still pending. In TEST 8 the second request's entry is therefore discarded whenever the first bulk request to Elasticsearch is still in flight, which is always the case when ES has to create the index first (fresh ES in CI). The test then never logs services-second-*.

This PR deletes the metadata at the end of TEST 1, the way t/plugin/elasticsearch-logger.t already does, so the later blocks run with the default limit. Verified locally with a fresh index before every run: 0/3 pass before, 3/3 after.

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

…er the discard test

TEST 1 of t/plugin/elasticsearch-logger2.t sets plugin metadata
max_pending_entries = 1 and leaves it in etcd for the rest of the file.
Since apache#13826 the batch processor discards a new entry while one is still
pending, so TEST 8 loses its second log entry whenever the first bulk
request to Elasticsearch is still in flight, which is always the case
when ES has to create the index first. Delete the metadata at the end of
TEST 1, as t/plugin/elasticsearch-logger.t already does.
@Hockenba

Hockenba commented Sep 10, 2026

Copy link
Copy Markdown

Note: Because of the flakiness, seems like #13651 is blocked by this PR. Please let me know once this is merged, so we can complete my PR. 🙂

@juzhiyuan
juzhiyuan merged commit a1e02b8 into apache:master Sep 14, 2026
16 checks passed
@janiussyafiq
janiussyafiq deleted the test-logger-metadata-leak branch September 14, 2026 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants