Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: try to collect failure log after test timeout #2986

Merged
merged 1 commit into from
Jun 7, 2024

Conversation

purelind
Copy link
Collaborator

@purelind purelind commented Jun 7, 2024

try to collect failure log after test timeout

Copy link

ti-chi-bot bot commented Jun 7, 2024

I have already done a preliminary review for you, and I hope to help you do a better job.

Based on the pull request title and description, it seems that the author is trying to implement a feature to collect failure logs after a test timeout. Looking at the diff, it seems that the change is only in the pull_lightning_integration_test.groovy file. The change is in the post section where the failure keyword is replaced with unsuccessful.

The change seems to be in the right direction as it is trying to collect logs after a test timeout. However, the change from failure to unsuccessful needs to be reviewed more carefully. The failure keyword is used to catch all types of failures, including build failures, test failures, and other types of failures. The unsuccessful keyword, on the other hand, is only used to catch test failures.

It is possible that the change from failure to unsuccessful might cause some logs to be missed if the failure is not a test failure. So, it is recommended to test the change thoroughly before merging it.

One possible fix would be to keep the failure keyword and add an additional step to catch test failures. For example, the following code can be added to catch test failures:

post {
  // Catch test failures
  always {
    junit 'target/surefire-reports/*.xml'
  }

  // Collect logs
  failure {
    sh label: "collect logs", script: """
      ls /tmp/lightning_test
      tar -cvzf log-${TEST_GROUP}.tar.gz \$(find /tmp/lightning_test/ -type f -name "*.log")
    """
  }
}

This way, all types of failures will be caught, and the logs will be collected after any type of failure.

@ti-chi-bot ti-chi-bot bot added the size/XS label Jun 7, 2024
@purelind
Copy link
Collaborator Author

purelind commented Jun 7, 2024

Copy link

ti-chi-bot bot commented Jun 7, 2024

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@purelind
Copy link
Collaborator Author

purelind commented Jun 7, 2024

/unhold

@ti-chi-bot ti-chi-bot bot merged commit 7260f48 into main Jun 7, 2024
2 checks passed
@ti-chi-bot ti-chi-bot bot deleted the purelind-patch-2 branch June 7, 2024 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant