Skip to content

Commit 43658f3

Browse files
authored
chore: fix flakey tests (GoogleCloudPlatform#1428)
1 parent 0c1bc61 commit 43658f3

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

functions/helloworld_pubsub/index.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,7 @@ function helloworldPubsub(CloudEvent $event): void
2626
$cloudEventData = $event->getData();
2727
$pubSubData = base64_decode($cloudEventData['message']['data']);
2828

29-
if ($pubSubData) {
30-
$name = htmlspecialchars($pubSubData);
31-
} else {
32-
$name = 'World';
33-
}
34-
35-
$result = 'Hello, ' . $name . '!';
36-
fwrite($log, $result . PHP_EOL);
29+
$name = $pubSubData ? htmlspecialchars($pubSubData) : 'World';
30+
fwrite($log, "Hello, $name!" . PHP_EOL);
3731
}
3832
// [END functions_helloworld_pubsub]

monitoring/test/alertsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public function testBackupPolicies()
190190

191191
/**
192192
* @depends testBackupPolicies
193-
* @retryAttempts 2
193+
* @retryAttempts 3
194194
* @retryDelaySeconds 10
195195
*/
196196
public function testRestorePolicies()

testing/run_test_suite.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ ALT_PROJECT_TESTS=(
6060
logging
6161
monitoring
6262
pubsub/api
63+
pubsub/quickstart
6364
storage
6465
spanner
6566
video

0 commit comments

Comments
 (0)