Skip to content

Commit b44e570

Browse files
authored
[FLINK-36564][ci] Running CI in random timezone to expose more time related bugs
This closes #3650
1 parent cd1fb6f commit b44e570

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

.github/workflows/flink_cdc_base.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ jobs:
151151
- name: Compile and test
152152
timeout-minutes: 60
153153
run: |
154+
. .github/workflows/utils.sh
155+
jvm_timezone=$(random_timezone)
156+
echo "JVM timezone is set to $jvm_timezone"
154157
set -o pipefail
155158
156159
case ${{ inputs.module }} in
@@ -218,7 +221,7 @@ jobs:
218221
219222
build_maven_parameter="${build_maven_parameter:+$build_maven_parameter }${{ inputs.custom-maven-parameter }}"
220223
221-
mvn --no-snapshot-updates -B -DskipTests -pl $compile_modules -am install && mvn --no-snapshot-updates -B $build_maven_parameter -pl $modules -DspecifiedParallelism=${{ inputs.parallelism }} verify
224+
mvn --no-snapshot-updates -B -DskipTests -pl $compile_modules -am install && mvn --no-snapshot-updates -B $build_maven_parameter -pl $modules -DspecifiedParallelism=${{ inputs.parallelism }} -Duser.timezone=$jvm_timezone verify
222225
223226
- name: Print JVM thread dumps when cancelled
224227
if: ${{ failure() }}

.github/workflows/utils.sh

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env bash
2+
################################################################################
3+
# Licensed to the Apache Software Foundation (ASF) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
################################################################################
19+
20+
function random_timezone() {
21+
local rnd=$(expr $RANDOM % 25)
22+
local hh=$(expr $rnd / 2)
23+
local mm=$(expr $rnd % 2 \* 3)"0"
24+
local sgn=$(expr $RANDOM % 2)
25+
if [ $sgn -eq 0 ]
26+
then
27+
echo "GMT+$hh:$mm"
28+
else
29+
echo "GMT-$hh:$mm"
30+
fi
31+
}

0 commit comments

Comments
 (0)