Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tutorial: make the tutorial workflow run a little slower #6047

Merged
merged 4 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ from glob import glob
import math
import os
import sys
import time

import util

Expand Down Expand Up @@ -115,4 +116,5 @@ def main():


if __name__ == '__main__':
time.sleep(2) # make the tutorial run a little slower
Copy link
Member

@MetRonnie MetRonnie Apr 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on these timings (without any sleeps) I would be tempted to make all the sleeps 4 secs so all the tasks take at least 5 secs.

image

Also one thing we can do to avoid sleeps on GH Actions would be (not that it matters that much)

Suggested change
time.sleep(2) # make the tutorial run a little slower
if 'CI' not in os.environ:
time.sleep(4) # make the tutorial run a little slower

main()
2 changes: 2 additions & 0 deletions cylc/flow/etc/tutorial/cylc-forecasting-workflow/bin/forecast
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Environment Variables:
import os
from subprocess import Popen, PIPE
import sys
import time

import util

Expand Down Expand Up @@ -242,6 +243,7 @@ def main(forecast_interval, forecast_iterations):


if __name__ == '__main__':
time.sleep(4) # make the tutorial run a little slower
try:
args = [int(sys.argv[1]), int(sys.argv[2])]
except IndexError:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ from datetime import datetime
import json
import os
import re
import time

import requests

Expand Down Expand Up @@ -215,5 +216,6 @@ def main(site_id, api_key=None):


if __name__ == '__main__':
time.sleep(2) # make the tutorial run a little slower
main(os.environ['SITE_ID'],
os.environ.get('API_KEY'))
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ from datetime import datetime
import math
import os
import shutil
import time

import requests

Expand Down Expand Up @@ -195,4 +196,5 @@ def main():


if __name__ == '__main__':
time.sleep(2) # make the tutorial run a little slower
main()
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Environment Variables:
from datetime import datetime, timedelta
import os
import sys
import time

import util

Expand Down Expand Up @@ -101,6 +102,7 @@ def main(site_name, time):


if __name__ == '__main__':
time.sleep(2) # make the tutorial run a little slower
try:
args = (sys.argv[1].lower(), int(sys.argv[2]))
except IndexError:
Expand Down
Loading