1+ name : Nightly Throughput Stress
2+
3+ on :
4+ schedule :
5+ # Run at 3 AM PST (11:00 UTC) - offset from existing nightly
6+ - cron : ' 00 11 * * *'
7+ push :
8+ branches :
9+ - add-nightly-throughput-stress-workflow
10+ workflow_dispatch :
11+ inputs :
12+ duration :
13+ description : ' Test duration (e.g., 6h, 1h)'
14+ required : false
15+ default : ' 5h'
16+ type : string
17+ timeout :
18+ description : ' Scenario timeout (should always be more than duration)'
19+ required : false
20+ default : ' 5h30m'
21+ type : string
22+ job_timeout_minutes :
23+ description : ' GitHub Actions job timeout in minutes'
24+ required : false
25+ default : 360
26+ type : number
27+
28+ env :
29+ # Workflow configuration
30+ TEST_DURATION : ${{ inputs.duration || vars.NIGHTLY_TEST_DURATION || '5h' }}
31+ TEST_TIMEOUT : ${{ inputs.timeout || vars.NIGHTLY_TEST_TIMEOUT || '5h30m' }}
32+
33+ # Logging and artifacts
34+ WORKER_LOG_DIR : /tmp/throughput-stress-logs
35+
36+ # Omes configuration
37+ OMES_REPO : temporalio/omes
38+ OMES_REF : main
39+ RUN_ID : ${{ github.run_id }}-throughput-stress
40+
41+ jobs :
42+ throughput-stress :
43+ runs-on : ubuntu-latest-4-cores
44+ timeout-minutes : ${{ fromJSON(inputs.job_timeout_minutes || vars.NIGHTLY_JOB_TIMEOUT_MINUTES || 360) }}
45+
46+ steps :
47+ - name : Print test configuration
48+ run : |
49+ echo "=== Throughput Stress Test Configuration ==="
50+ echo "Duration: $TEST_DURATION"
51+ echo "Timeout: $TEST_TIMEOUT"
52+ echo "Run ID: $RUN_ID"
53+ echo "=========================================="
54+
55+ - name : Checkout SDK
56+ uses : actions/checkout@v5
57+ with :
58+ submodules : recursive
59+
60+ - name : Checkout OMES
61+ uses : actions/checkout@v5
62+ with :
63+ repository : ${{ env.OMES_REPO }}
64+ ref : ${{ env.OMES_REF }}
65+ path : omes
66+
67+ - name : Setup Go
68+ uses : actions/setup-go@v5
69+ with :
70+ go-version-file : omes/go.mod
71+ cache-dependency-path : omes/go.sum
72+
73+ - name : Set up Java
74+ uses : actions/setup-java@v5
75+ with :
76+ java-version : " 11"
77+ distribution : " temurin"
78+
79+ - name : Set up Gradle
80+ uses : gradle/actions/setup-gradle@v4
81+
82+ - name : Build SDK
83+ run : ./gradlew build -x test
84+
85+ - name : Install Temporal CLI
86+ uses : temporalio/setup-temporal@v0
87+
88+ - name : Setup log directory
89+ run : mkdir -p $WORKER_LOG_DIR
90+
91+ - name : Start Temporal Server
92+ run : |
93+ temporal server start-dev \
94+ --db-filename temporal-throughput-stress.sqlite \
95+ --sqlite-pragma journal_mode=WAL \
96+ --sqlite-pragma synchronous=OFF \
97+ --headless &> $WORKER_LOG_DIR/temporal-server.log &
98+
99+ - name : Run throughput stress scenario with local SDK
100+ working-directory : omes
101+ run : |
102+ # This makes the pipeline return the exit code of the first failing command
103+ # Otherwise the output of the `tee` command will be used
104+ # (which is troublesome when the scenario fails but the `tee` command succeeds)
105+ set -o pipefail
106+
107+ # Use run-scenario-with-worker to build and run in one step
108+ # Pass the SDK directory as --version for local testing
109+ # Note: The hardcoded values below match OMES defaults, except:
110+ # - visibility-count-timeout: 5m (vs 3m default)
111+ # to give CI a bit more time for visibility consistency
112+ go run ./cmd run-scenario-with-worker \
113+ --scenario throughput_stress \
114+ --language java \
115+ --version $(pwd)/../sdk-java \
116+ --run-id $RUN_ID \
117+ --duration $TEST_DURATION \
118+ --timeout $TEST_TIMEOUT \
119+ --max-concurrent 10 \
120+ --option internal-iterations=10 \
121+ --option continue-as-new-after-iterations=3 \
122+ --option sleep-time=1s \
123+ --option visibility-count-timeout=5m \
124+ --option min-throughput-per-hour=1000 \
125+ 2>&1 | tee $WORKER_LOG_DIR/scenario.log
126+
127+ - name : Upload logs on failure
128+ if : failure() || cancelled()
129+ uses : actions/upload-artifact@v4
130+ with :
131+ name : throughput-stress-logs
132+ path : ${{ env.WORKER_LOG_DIR }}
133+ retention-days : 30
134+
135+ - name : Notify Slack on failure
136+ if : failure() || cancelled()
137+ uses : slackapi/slack-github-action@v2
138+ with :
139+ payload : |
140+ {
141+ "text": "Nightly Java throughput stress test failed",
142+ "blocks": [
143+ {
144+ "type": "section",
145+ "text": {
146+ "type": "mrkdwn",
147+ "text": "*Nightly Throughput Stress Failed* :x:\n\n*Duration:* ${{ env.TEST_DURATION }}\n*Run:* <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Logs>\n*Triggered by:* ${{ github.event_name == 'schedule' && 'Scheduled' || github.actor }}"
148+ }
149+ }
150+ ]
151+ }
152+ env :
153+ SLACK_WEBHOOK_URL : ${{ secrets.SLACK_SDK_ALERTS_WEBHOOK }}
0 commit comments