Skip to content

[improve] fix e2e test failure caused by api-testing reverse test behavior#4091

Merged
zqr10159 merged 2 commits intoapache:masterfrom
P-Peaceful:improve-e2e-test-failure
Mar 25, 2026
Merged

[improve] fix e2e test failure caused by api-testing reverse test behavior#4091
zqr10159 merged 2 commits intoapache:masterfrom
P-Peaceful:improve-e2e-test-failure

Conversation

@P-Peaceful
Copy link
Copy Markdown
Contributor

What's changed?

This PR fixes the e2e test failure caused by the api-testing reverse test behavior.

Description

api-testing automatically runs reverse tests after the main test cases.

For requests with Authorization header, reverse test will:

  • keep the original header
  • replace it with a random value
  • remove the header

In the removed useRevokedTokenToCallApi case:

  • both "invalid token" and "missing token" scenarios return 401
  • response body is empty / non-structured
  • therefore body assertion is skipped

As a result:

  • reverse test cannot distinguish between expected and abnormal cases
  • the case is considered unsuitable for reverse testing
  • the whole test execution is marked as failed

Example logs:


e2e-testing    | start to run: 'createLabel'
e2e-testing    | start to send request to http://hertzbeat:1157/api/label with method POST
e2e-testing    | request header map[Authorization:[*** Content-Type:[application/json]]
e2e-testing    | test case "createLabel", status code: 200
e2e-testing    | add content-length: 42
e2e-testing    | start to run: 'createLabel'
e2e-testing    | start to send request to http://hertzbeat:1157/api/label with method POST
e2e-testing    | request header map[Content-Type:[application/json]]
e2e-testing    | test case "createLabel", status code: 401
e2e-testing    | skip to read the body due to it is not struct content: ""
e2e-testing    | start to run: 'createLabel'
e2e-testing    | start to send request to http://hertzbeat:1157/api/label with method POST
e2e-testing    | request header map[Authorization:[sh7s2m] Content-Type:[application/json]]
e2e-testing    | test case "createLabel", status code: 401
e2e-testing    | skip to read the body due to it is not struct content: ""

Changes

  • remove useRevokedTokenToCallApi case from e2e/testsuite.yaml
  • upgrade ghcr.io/linuxsuren/api-testing from v0.0.17 to v0.0.19
    • newer version provides more detailed request logs for debugging

These changes make the e2e workflow stable and compatible with the current api-testing behavior.

Checklist

  • I have read the Contributing Guide
  • I have written the necessary doc or comment.
  • I have added the necessary unit tests and all cases have passed.

Add or update API

  • I have added the necessary e2e tests and all cases have passed.

Signed-off-by: P_Peaceful <wenzhengcheng0223@163.com>
Signed-off-by: P_Peaceful <wenzhengcheng0223@163.com>
@P-Peaceful
Copy link
Copy Markdown
Contributor Author

@tomsun28 @yuluo-yx @zqr10159 this PR might be able to resolve the E2E test failure. #4088

@github-actions github-actions Bot added the e2e label Mar 25, 2026
@zqr10159 zqr10159 merged commit cdb6411 into apache:master Mar 25, 2026
3 checks passed
@P-Peaceful P-Peaceful deleted the improve-e2e-test-failure branch March 30, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants