Skip to content

Commit

Permalink
Add a 30 second sleep in mass_comment.py to avoid overwhelming Jenkins (
Browse files Browse the repository at this point in the history
apache#25714)

* Add a 30 second sleep in mass_comment.py to avoid overwhelming Jenkins

* Update comment_pr_trigger_phrases.sh
  • Loading branch information
damccorm authored and ruslan-ikhsan committed Mar 10, 2023
1 parent 1491652 commit cfd91ea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions release/src/main/scripts/mass_comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@

"""Script for mass-commenting Jenkins test triggers on a Beam PR."""

import socket
import requests
import socket
import time

# This list can be found by querying the Jenkins API, see BEAM-13951
COMMENTS_TO_ADD = [
Expand Down Expand Up @@ -56,7 +57,6 @@
"Run Java Examples_Flink",
"Run Java Examples_Spark",
"Run Java Flink PortableValidatesRunner Streaming",
"Run Java Portability examples on Dataflow with Java 11",
"Run Java PostCommit",
"Run Java PreCommit",
"Run Java Samza PortableValidatesRunner",
Expand Down Expand Up @@ -223,6 +223,8 @@ def postComments(accessToken, subjectId):

for commentBody in COMMENTS_TO_ADD:
jsonData = fetchGHData(accessToken, subjectId, commentBody)
# Space out comments 30 seconds apart to avoid overwhelming Jenkins
time.sleep(30)
print(jsonData)


Expand Down
1 change: 1 addition & 0 deletions scripts/ci/release/comment_pr_trigger_phrases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ GITHUB_PR=$1
while IFS= read -r trigger_phrase
do
gh pr comment "$GITHUB_PR" --body "$trigger_phrase"
sleep 30
done <"$file"

0 comments on commit cfd91ea

Please sign in to comment.