Skip to content

Commit 7ae22ef

Browse files
authored
truncate the query result from CloudWatch in case of stucking the git… (#585)
…hub workflow *Issue description:* When the cloudwatch logs entry is too big, around 1MB, the validator will stuck the testing workflow. *Description of changes:* This change truncates the print of java log *Rollback procedure:* <Can we safely revert this commit if needed? If not, detail what must be done to safely revert and why it is needed.> *Ensure you've run the following tests on your changes and include the link below:* To do so, create a `test.yml` file with `name: Test` and workflow description to test your changes, then remove the file for your PR. Link your test run in your PR description. This process is a short term solution while we work on creating a staging environment for testing. NOTE: TESTS RUNNING ON A SINGLE EKS CLUSTER CANNOT BE RUN IN PARALLEL. See the [needs](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idneeds) keyword to run tests in succession. - Run Java EKS on `e2e-playground` in us-east-1 and eu-central-2 - Run Python EKS on `e2e-playground` in us-east-1 and eu-central-2 - Run metric limiter on EKS cluster `e2e-playground` in us-east-1 and eu-central-2 - Run EC2 tests in all regions - Run K8s on a separate K8s cluster (check IAD test account for master node endpoints; these will change as we create and destroy clusters for OS patching) By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 22e1ec5 commit 7ae22ef

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

.github/workflows/python-ec2-genesis-v2-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ jobs:
3838
steps:
3939
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4040
with:
41-
repository: 'wangzlei/aws-application-signals-test-framework'
42-
ref: main
41+
repository: 'aws-observability/aws-application-signals-test-framework'
42+
ref: ${{ inputs.caller-workflow-name == 'main-build' && 'main' || github.ref }}
4343
fetch-depth: 0
4444

4545
- name: Set Get ADOT Wheel command environment variable

validator/src/main/java/com/amazon/aoc/validators/CWLogValidator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ public void validate() throws Exception {
119119
this.getActualLog(operation, remoteService, remoteOperation, remoteResourceType, remoteResourceIdentifier);
120120
}
121121
}
122-
log.info("Value of an actual log: {}", actualLog);
122+
String actualLogStr = actualLog != null ? actualLog.toString() : "null";
123+
log.info("Value of an actual log: {}", actualLogStr.length() > 2000 ? actualLogStr.substring(0, 2000) + "...(truncated)" : actualLogStr);
124+
log.debug("Value of an actual log: {}", actualLogStr);
123125

124126
if (actualLog == null) throw new BaseException(ExceptionCode.EXPECTED_LOG_NOT_FOUND);
125127

0 commit comments

Comments
 (0)