Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 05f6746

Browse files
authored
fix put-metric-alarm test failure rate (#12598)
1 parent edb9628 commit 05f6746

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

‎tests/aws/services/cloudwatch/test_cloudwatch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,8 +1318,8 @@ def test_put_metric_alarm(
13181318
MetricName=metric_name,
13191319
Namespace=namespace,
13201320
ActionsEnabled=True,
1321-
Period=30,
1322-
Threshold=2,
1321+
Period=10,
1322+
Threshold=21,
13231323
Dimensions=dimension,
13241324
Unit="Seconds",
13251325
Statistic="Average",

‎tests/aws/services/cloudwatch/test_cloudwatch.snapshot.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@
369369
}
370370
},
371371
"tests/aws/services/cloudwatch/test_cloudwatch.py::TestCloudwatch::test_put_metric_alarm": {
372-
"recorded-date": "19-01-2024, 13:46:30",
372+
"recorded-date": "12-05-2025, 16:20:57",
373373
"recorded-content": {
374374
"describe-alarm": {
375375
"CompositeAlarms": [],
@@ -397,13 +397,13 @@
397397
"OKActions": [
398398
"arn:<partition>:sns:<region>:111111111111:<topic_arn>"
399399
],
400-
"Period": 30,
400+
"Period": 10,
401401
"StateReason": "Unchecked: Initial alarm creation",
402402
"StateTransitionedTimestamp": "timestamp",
403403
"StateUpdatedTimestamp": "timestamp",
404404
"StateValue": "INSUFFICIENT_DATA",
405405
"Statistic": "Average",
406-
"Threshold": 2.0,
406+
"Threshold": 21.0,
407407
"TreatMissingData": "ignore",
408408
"Unit": "Seconds"
409409
}
@@ -423,7 +423,7 @@
423423
"AlarmDescription": "testing cloudwatch alarms",
424424
"AlarmName": "<alarm-name:1>",
425425
"InsufficientDataActions": [],
426-
"NewStateReason": "Threshold Crossed: 1 datapoint [21.5 (MM/DD/YY HH:MM:SS)] was greater than the threshold (2.0).",
426+
"NewStateReason": "Threshold Crossed: 1 datapoint [21.5 (MM/DD/YY HH:MM:SS)] was greater than the threshold (21.0).",
427427
"NewStateValue": "ALARM",
428428
"OKActions": [
429429
"arn:<partition>:sns:<region>:111111111111:<topic_arn>"
@@ -443,10 +443,10 @@
443443
"EvaluationPeriods": 1,
444444
"MetricName": "my-metric1",
445445
"Namespace": "<namespace:1>",
446-
"Period": 30,
446+
"Period": 10,
447447
"Statistic": "AVERAGE",
448448
"StatisticType": "Statistic",
449-
"Threshold": 2.0,
449+
"Threshold": 21.0,
450450
"TreatMissingData": "ignore",
451451
"Unit": "Seconds"
452452
}
@@ -464,18 +464,18 @@
464464
},
465465
"newState": {
466466
"stateValue": "ALARM",
467-
"stateReason": "Threshold Crossed: 1 datapoint [21.5 (MM/DD/YY HH:MM:SS)] was greater than the threshold (2.0).",
467+
"stateReason": "Threshold Crossed: 1 datapoint [21.5 (MM/DD/YY HH:MM:SS)] was greater than the threshold (21.0).",
468468
"stateReasonData": {
469469
"version": "1.0",
470470
"queryDate": "date",
471471
"startDate": "date",
472472
"unit": "Seconds",
473473
"statistic": "Average",
474-
"period": 30,
474+
"period": 10,
475475
"recentDatapoints": [
476476
21.5
477477
],
478-
"threshold": 2.0,
478+
"threshold": 21.0,
479479
"evaluatedDatapoints": [
480480
{
481481
"timestamp": "date",
@@ -521,19 +521,19 @@
521521
"OKActions": [
522522
"arn:<partition>:sns:<region>:111111111111:<topic_arn>"
523523
],
524-
"Period": 30,
525-
"StateReason": "Threshold Crossed: 1 datapoint [21.5 (MM/DD/YY HH:MM:SS)] was greater than the threshold (2.0).",
524+
"Period": 10,
525+
"StateReason": "Threshold Crossed: 1 datapoint [21.5 (MM/DD/YY HH:MM:SS)] was greater than the threshold (21.0).",
526526
"StateReasonData": {
527527
"version": "1.0",
528528
"queryDate": "date",
529529
"startDate": "date",
530530
"unit": "Seconds",
531531
"statistic": "Average",
532-
"period": 30,
532+
"period": 10,
533533
"recentDatapoints": [
534534
21.5
535535
],
536-
"threshold": 2.0,
536+
"threshold": 21.0,
537537
"evaluatedDatapoints": [
538538
{
539539
"timestamp": "date",
@@ -546,7 +546,7 @@
546546
"StateUpdatedTimestamp": "timestamp",
547547
"StateValue": "ALARM",
548548
"Statistic": "Average",
549-
"Threshold": 2.0,
549+
"Threshold": 21.0,
550550
"TreatMissingData": "ignore",
551551
"Unit": "Seconds"
552552
}

‎tests/aws/services/cloudwatch/test_cloudwatch.validation.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"last_validated_date": "2024-07-29T07:56:05+00:00"
5858
},
5959
"tests/aws/services/cloudwatch/test_cloudwatch.py::TestCloudwatch::test_put_metric_alarm": {
60-
"last_validated_date": "2024-01-19T14:26:26+00:00"
60+
"last_validated_date": "2025-05-12T16:20:56+00:00"
6161
},
6262
"tests/aws/services/cloudwatch/test_cloudwatch.py::TestCloudwatch::test_put_metric_data_values_list": {
6363
"last_validated_date": "2023-09-25T08:26:17+00:00"

0 commit comments

Comments
 (0)