From 1a923fc1aaf91e2d5743986983aa3f1c4d772832 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Mon, 26 Apr 2021 13:27:59 +0200 Subject: [PATCH 1/9] set random date for test --- planemo_ci_actions.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/planemo_ci_actions.sh b/planemo_ci_actions.sh index ecc683d..23dc95c 100755 --- a/planemo_ci_actions.sh +++ b/planemo_ci_actions.sh @@ -128,6 +128,13 @@ fi # - merge the test reports for the tool groups if [ "$MODE" == "test" ]; then + # set a random date. ofen tools put time stamps in output files + # for tools undergoing short reviews (<1d) these will produce + # problems with weekly checks that may be avoided by this + rand=$(echo "$RANDOM * $RANDOM * $RANDOM / 1000" | bc -l) + randdate=$(date -d "$rand" +%Y%m%d %H:%M) + sudo date -s "$randdate" + if [ "$WORKFLOWS" == "true" ] && [ "$SETUP_CVMFS" == "true" ]; then "$GITHUB_ACTION_PATH"/cvmfs/setup_cvmfs.sh fi From fc73844a3ff342ebda242c3c45b03804a62282c1 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Tue, 27 Apr 2021 10:40:37 +0200 Subject: [PATCH 2/9] make random number an int --- planemo_ci_actions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/planemo_ci_actions.sh b/planemo_ci_actions.sh index 23dc95c..349f2f2 100755 --- a/planemo_ci_actions.sh +++ b/planemo_ci_actions.sh @@ -131,7 +131,7 @@ if [ "$MODE" == "test" ]; then # set a random date. ofen tools put time stamps in output files # for tools undergoing short reviews (<1d) these will produce # problems with weekly checks that may be avoided by this - rand=$(echo "$RANDOM * $RANDOM * $RANDOM / 1000" | bc -l) + rand=$(echo "$RANDOM * $RANDOM * $RANDOM / 1000" | bc -l | sed 's/\..*$//') randdate=$(date -d "$rand" +%Y%m%d %H:%M) sudo date -s "$randdate" From b4d5d5b8d292d06dac93c21610eab73ceabf9084 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Tue, 27 Apr 2021 11:13:17 +0200 Subject: [PATCH 3/9] fix quotation --- planemo_ci_actions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/planemo_ci_actions.sh b/planemo_ci_actions.sh index 349f2f2..4588195 100755 --- a/planemo_ci_actions.sh +++ b/planemo_ci_actions.sh @@ -132,7 +132,7 @@ if [ "$MODE" == "test" ]; then # for tools undergoing short reviews (<1d) these will produce # problems with weekly checks that may be avoided by this rand=$(echo "$RANDOM * $RANDOM * $RANDOM / 1000" | bc -l | sed 's/\..*$//') - randdate=$(date -d "$rand" +%Y%m%d %H:%M) + randdate=$(date -d "$rand" "+%Y%m%d %H:%M") sudo date -s "$randdate" if [ "$WORKFLOWS" == "true" ] && [ "$SETUP_CVMFS" == "true" ]; then From c707d551146d61bc318ffc3cb4af03a905bc175d Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Tue, 27 Apr 2021 11:22:16 +0200 Subject: [PATCH 4/9] add @ --- planemo_ci_actions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/planemo_ci_actions.sh b/planemo_ci_actions.sh index 4588195..77e39f6 100755 --- a/planemo_ci_actions.sh +++ b/planemo_ci_actions.sh @@ -132,7 +132,7 @@ if [ "$MODE" == "test" ]; then # for tools undergoing short reviews (<1d) these will produce # problems with weekly checks that may be avoided by this rand=$(echo "$RANDOM * $RANDOM * $RANDOM / 1000" | bc -l | sed 's/\..*$//') - randdate=$(date -d "$rand" "+%Y%m%d %H:%M") + randdate=$(date -d "@$rand" "+%Y%m%d %H:%M") sudo date -s "$randdate" if [ "$WORKFLOWS" == "true" ] && [ "$SETUP_CVMFS" == "true" ]; then From 09d64c1a3fb55a1cb2468b23c28e52a0ae80ef64 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Tue, 27 Apr 2021 11:37:00 +0200 Subject: [PATCH 5/9] debug --- planemo_ci_actions.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/planemo_ci_actions.sh b/planemo_ci_actions.sh index 77e39f6..0e2e6c2 100755 --- a/planemo_ci_actions.sh +++ b/planemo_ci_actions.sh @@ -133,6 +133,7 @@ if [ "$MODE" == "test" ]; then # problems with weekly checks that may be avoided by this rand=$(echo "$RANDOM * $RANDOM * $RANDOM / 1000" | bc -l | sed 's/\..*$//') randdate=$(date -d "@$rand" "+%Y%m%d %H:%M") + echo $randdate sudo date -s "$randdate" if [ "$WORKFLOWS" == "true" ] && [ "$SETUP_CVMFS" == "true" ]; then From 344ee010263fba1a596c0c6f615d6bb99ce00916 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Tue, 27 Apr 2021 11:38:13 +0200 Subject: [PATCH 6/9] debug --- planemo_ci_actions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/planemo_ci_actions.sh b/planemo_ci_actions.sh index 0e2e6c2..02b3f9b 100755 --- a/planemo_ci_actions.sh +++ b/planemo_ci_actions.sh @@ -133,7 +133,7 @@ if [ "$MODE" == "test" ]; then # problems with weekly checks that may be avoided by this rand=$(echo "$RANDOM * $RANDOM * $RANDOM / 1000" | bc -l | sed 's/\..*$//') randdate=$(date -d "@$rand" "+%Y%m%d %H:%M") - echo $randdate + echo "$randdate" sudo date -s "$randdate" if [ "$WORKFLOWS" == "true" ] && [ "$SETUP_CVMFS" == "true" ]; then From cc510c574c9dbf73bd62001ff5565183e132d0b8 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Tue, 27 Apr 2021 14:17:03 +0200 Subject: [PATCH 7/9] just use small time offset --- planemo_ci_actions.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/planemo_ci_actions.sh b/planemo_ci_actions.sh index 02b3f9b..e621314 100755 --- a/planemo_ci_actions.sh +++ b/planemo_ci_actions.sh @@ -131,8 +131,9 @@ if [ "$MODE" == "test" ]; then # set a random date. ofen tools put time stamps in output files # for tools undergoing short reviews (<1d) these will produce # problems with weekly checks that may be avoided by this - rand=$(echo "$RANDOM * $RANDOM * $RANDOM / 1000" | bc -l | sed 's/\..*$//') - randdate=$(date -d "@$rand" "+%Y%m%d %H:%M") + # rand=$(echo "$RANDOM * $RANDOM * $RANDOM / 1000" | bc -l | sed 's/\..*$//') + # randdate=$(date -d "@$rand" "+%Y%m%d %H:%M") + randdate=$(date -d "-1 day +1 hour -1 minute" "+%Y%m%d %H:%M") echo "$randdate" sudo date -s "$randdate" From a48d8a19b48994704aeb9fdc45bbbc538e5aa088 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Tue, 27 Apr 2021 14:45:55 +0200 Subject: [PATCH 8/9] use timedatectl --- planemo_ci_actions.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/planemo_ci_actions.sh b/planemo_ci_actions.sh index e621314..f4764ce 100755 --- a/planemo_ci_actions.sh +++ b/planemo_ci_actions.sh @@ -133,9 +133,10 @@ if [ "$MODE" == "test" ]; then # problems with weekly checks that may be avoided by this # rand=$(echo "$RANDOM * $RANDOM * $RANDOM / 1000" | bc -l | sed 's/\..*$//') # randdate=$(date -d "@$rand" "+%Y%m%d %H:%M") - randdate=$(date -d "-1 day +1 hour -1 minute" "+%Y%m%d %H:%M") + randdate=$(date -d "-1 day +1 hour -1 minute" "+%Y-%m-%d %H:%M:%S") echo "$randdate" - sudo date -s "$randdate" + # sudo date -s "$randdate" + sudo timedatectl set-time "$randdate" if [ "$WORKFLOWS" == "true" ] && [ "$SETUP_CVMFS" == "true" ]; then "$GITHUB_ACTION_PATH"/cvmfs/setup_cvmfs.sh From 7d0412f1eee55b4d55c1f220d44e2a6a0369d100 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Tue, 27 Apr 2021 14:59:13 +0200 Subject: [PATCH 9/9] disable ntp --- planemo_ci_actions.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/planemo_ci_actions.sh b/planemo_ci_actions.sh index f4764ce..2d25fce 100755 --- a/planemo_ci_actions.sh +++ b/planemo_ci_actions.sh @@ -136,6 +136,7 @@ if [ "$MODE" == "test" ]; then randdate=$(date -d "-1 day +1 hour -1 minute" "+%Y-%m-%d %H:%M:%S") echo "$randdate" # sudo date -s "$randdate" + sudo timedatectl set-ntp 0 sudo timedatectl set-time "$randdate" if [ "$WORKFLOWS" == "true" ] && [ "$SETUP_CVMFS" == "true" ]; then