Skip to content

Commit

Permalink
added a test
Browse files Browse the repository at this point in the history
  • Loading branch information
wxtim committed Nov 21, 2018
1 parent be61ec9 commit abdfe87
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions lib/cylc/task_job_mgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,14 @@ def submit_task_jobs(self, suite, itasks, is_simulation=False):
# to prevent overloading of stdout and stderr pipes.
cmd_base = cmd
itasks = sorted(itasks, key=lambda itask: itask.identity)
itasks_batches = (
itasks[i:i + 100] for i in range(0, len(itasks), 100))
itasks_batches = [
itasks[i:i + 100] for i in range(0, len(itasks), 100)]
for i, itasks_batch in enumerate(itasks_batches):
debug_msg = ("Looking at itasks_batch number {0} which "
debug_msg = ("Looking at itasks_batch number {0}/{2} which "
"contains {1} tasks")
LOG.debug(debug_msg.format(i, len(itasks_batch)))
LOG.debug(debug_msg.format(i + 1,
len(itasks_batch),
len(itasks_batches)))
stdin_file_paths = []
job_log_dirs = []
for itask in itasks_batch:
Expand Down
4 changes: 2 additions & 2 deletions tests/job-submission/18-check-chunking.t
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ LOG_FILE=$(cylc cat-log $SUITE_NAME -m p)
echo $LOG_FILE >&2

TEST_NAME=${TEST_NAME_BASE}-itasks-msg
grep_ok "Looking at itasks_batch number 0 which contains 100 tasks" $LOG_FILE
grep_ok "Looking at itasks_batch number 2 which contains 2 tasks" $LOG_FILE
grep_ok "Looking at itasks_batch number 1/3 which contains 100 tasks" $LOG_FILE
grep_ok "Looking at itasks_batch number 3/3 which contains 2 tasks" $LOG_FILE

# tidy up
purge_suite $SUITE_NAME
Expand Down

0 comments on commit abdfe87

Please sign in to comment.