OILS / regtest / aports-run.sh View on Github | oils.pub

753 lines, 348 significant
1#!/usr/bin/env bash
2#
3# Build Alpine Linux packages: baseline, OSH as /bin/sh, OSH as /bin/bash
4# See regtest/aports.md
5#
6# Usage:
7# regtest/aports-run.sh <function name>
8#
9# Common usage:
10#
11# export APORTS_EPOCH=2025-08-04-foo # optional override
12# $0 build-many-shards-overlayfs shard{0..16} # build all 17 shards in 2 configs
13#
14# Also useful:
15#
16# $0 fetch-packages fetch $pkg_filter $a_repo # alpine repo is 'main' or 'community'
17#
18# $0 fetch-packages fetch 100,300p # packages 100-300
19# $0 fetch-packages fetch '.*' # all packages
20#
21# Look for results in _tmp/aports-build/
22#
23# Build many packages:
24#
25# $0 build-packages-overlayfs osh-as-sh shard9 community
26# $0 build-packages-overlayfs osh-as-sh shardA # main is default $a_repo
27#
28# Build a single package:
29#
30# $0 build-package-overlayfs osh-as-sh userspace-rcu
31# $0 build-package-overlayfs osh-as-sh xterm community # community repo
32#
33# Drop into a shell:
34# INTERACTIVE=1 $0 build-package-overlayfs osh-as-sh userspace-rcu
35#
36# PKG_FILTER
37# shard[0-9]+ - shard3 is packages 301 to 400
38# [0-9]+ - 42 means build the first 42 packages
39# [0-9]+,[0-9]+p - 100,300p packages 100 to 300 (sed syntax)
40# ALL - all packages
41# .* - egrep pattern matching all packages
42# curl - egrep pattern matching 'curl'
43#
44# Preview packages:
45#
46# $0 package-dirs shard9 community
47
48: ${LIB_OSH=stdlib/osh}
49source $LIB_OSH/bash-strict.sh
50source $LIB_OSH/task-five.sh
51
52source regtest/aports-common.sh
53
54#
55# Config
56#
57
58show-config() {
59 enter-rootfs sh -c '
60 ls -l /bin/sh /bin/ash /bin/bash
61 '
62}
63
64set-baseline() {
65 # ensure we have the default config
66 enter-rootfs sh -c '
67 set -x
68 ln -s -f /bin/busybox /bin/sh
69 ln -s -f /bin/busybox /bin/ash
70 cp /bin/bash.ORIG /bin/bash
71 '
72 show-config
73}
74
75set-osh-as-X() {
76 local x=$1
77
78 enter-rootfs sh -c '
79 x=$1
80 set -x
81 if ! test -f /usr/local/bin/oils-for-unix; then
82 echo "Build Oils first"
83 exit
84 fi
85 ln -s -f /usr/local/bin/oils-for-unix /bin/$x
86 ' dummy0 "$x"
87 show-config
88}
89
90set-osh-as-sh() {
91 set-osh-as-X sh
92}
93
94set-osh-as-ash() {
95 set-osh-as-X ash
96}
97
98set-osh-as-bash() {
99 set-osh-as-X bash
100}
101
102#
103# Run
104#
105
106package-dirs() {
107 # lz gives 5 packages: some fail at baseline
108 # lzip: a single fast package
109 # mpfr4: OSH bug, and big log
110 # yash: make sure it doesn't hang
111 local package_filter=${1:-'lz|mpfr|yash'}
112 local a_repo=${2:-main} # or 'community'
113
114 local -a prefix
115
116 if [[ $package_filter = 'ALL' ]]; then
117 prefix=( cat )
118
119 # 100 means 0 to 100
120 elif [[ $package_filter =~ ^[0-9]+$ ]]; then
121 prefix=( head -n $package_filter )
122
123 # 100,300p means lines 100 to 300
124 elif [[ $package_filter =~ ^[0-9]+,[0-9]+p$ ]]; then
125 prefix=( sed -n $package_filter )
126
127 elif [[ $package_filter =~ ^shard([0-9]+)$ ]]; then
128 # shards of 100 packages
129
130 local shard_num=${BASH_REMATCH[1]}
131 #echo shard=$shard_num
132
133 local range
134 # shard 0 is 0-99
135 # shard 9 is 900 to 999
136 # shard 10 is 1000 to 1099
137 case $shard_num in
138 # sed doesn't like 000,099
139 0) range='1,100p' ;;
140 *) range="${shard_num}01,$(( shard_num + 1))00p" ;;
141 esac
142
143 prefix=( sed -n "$range" )
144
145 # shardA, shardB For testing the combined report
146 elif [[ $package_filter =~ ^shard([A-Z]+)$ ]]; then
147 local shard_name=${BASH_REMATCH[1]}
148 case $a_repo in
149 main)
150 case $shard_name in
151 A) package_filter='^gzip' ;; # failure
152 B) package_filter='^xz' ;; # failure
153 C) package_filter='^lz' ;; # 3 packages
154 D) package_filter='^jq$' ;; # produces autotools test-suite.log
155 E) package_filter='^py3-p' ;; # many packages in parallel
156 F) package_filter='^py3-pathspec' ;; # very fast package
157 P) package_filter='^xz$|^shorewall' ;; # patches
158 *) package_filter='^perl-http-daemon' ;; # test out perl
159 esac
160 ;;
161 community)
162 case $shard_name in
163 A) package_filter='^py3-zulip' ;; # one Python package
164 B) package_filter='^xterm' ;; # one C package
165 C) package_filter='^shfmt' ;; # one Go package
166 D) package_filter='^shellspec' ;; # OSH disagreement because of 'var'
167 *) package_filter='^shell' ;; # a bunch of packages
168 esac
169 ;;
170 *)
171 die "Invalid a_repo $a_repo"
172 ;;
173 esac
174
175 prefix=( egrep "$package_filter" )
176
177 elif [[ $package_filter =~ ^disagree-(.*)+$ ]]; then
178 local filename=${BASH_REMATCH[1]}
179 # A file of EXACT package names, not patterns
180 # See copy-disagree
181 local package_file="_tmp/$package_filter.txt"
182 comm -1 -2 <(sort $package_file) <(sort _tmp/apk-${a_repo}-manifest.txt)
183 return
184
185 else
186 prefix=( egrep "$package_filter" )
187
188 fi
189
190 "${prefix[@]}" _tmp/apk-${a_repo}-manifest.txt
191}
192
193copy-disagree() {
194 ### Determine what to run
195
196 local epoch=${1:-2025-09-18-bash}
197 cp -v \
198 _tmp/aports-report/$epoch/disagree-packages.txt \
199 _tmp/disagree-$epoch.txt
200}
201
202do-packages() {
203 ### Download sources - abuild puts it in /var/cahe/distfiles
204 local action=${1:-fetch}
205 local package_filter=${2:-}
206 local a_repo=${3:-main}
207 # flags to pass to the inner shell
208 local sh_flags=${4:-'-e -u'} # -u to disable -e
209
210 # 6 seconds for 10 packages
211 # There are ~1600 packages
212 # So if there are 20 shards, each shard could have 10?
213
214 local -a package_dirs
215 package_dirs=( $(package-dirs "$package_filter" "$a_repo") )
216
217 echo "${dirs[@]}"
218 #return
219
220 time enter-rootfs-user sh $sh_flags -c '
221
222 action=$1
223 a_repo=$2
224 shift 2
225 for dir in "$@"; do
226 time abuild -r -C aports/$a_repo/$dir "$action"
227 done
228 ' dummy0 "$action" "$a_repo" "${package_dirs[@]}"
229}
230
231fetch-packages() {
232 local package_filter=${1:-}
233 local a_repo=${2:-main}
234
235 # -u means we don't pass -e (and it's non-empty)
236 do-packages fetch "$package_filter" "$a_repo" '-u'
237}
238
239banner() {
240 echo
241 echo "=== $@"
242 echo
243}
244
245build-package-overlayfs() {
246 local config=${1:-baseline}
247 local pkg=${2:-lua5.4}
248 local a_repo=${3:-main}
249
250 # baseline stack:
251 # _chroot/aports-build
252 # _chroot/package-upper/baseline/gzip # upper dir / layer dir
253 #
254 # osh-as-sh stack:
255 # _chroot/aports-build
256 # _chroot/osh-as-sh.overlay/layer # this has the symlink
257 # _chroot/package-upper/osh-as-sh/gzip # upper dir / layer dir
258
259 # allow concurrency
260 local xargs_slot="${XARGS_SLOT:-99}"
261 local ov_base_dir=_chroot/package-slot${xargs_slot}.overlay
262
263 local merged=$ov_base_dir/merged
264 local work=$ov_base_dir/work
265
266 local layer_dir=_chroot/package-layers/$config/$pkg
267 mkdir -p $merged $work $layer_dir
268
269 local overlay_opts
270 case $config in
271 baseline)
272 overlay_opts="lowerdir=$CHROOT_DIR,upperdir=$layer_dir,workdir=$work"
273 ;;
274 osh-as-sh)
275 local osh_as_sh=_chroot/osh-as-sh.overlay/layer
276 overlay_opts="lowerdir=$osh_as_sh:$CHROOT_DIR,upperdir=$layer_dir,workdir=$work"
277 ;;
278 *)
279 die "Invalid config $config"
280 ;;
281 esac
282
283 # -o index=off fixes this error: fsconfig() failed: Stale file handle
284 # See also https://oilshell.zulipchat.com/#narrow/channel/522730-distros/topic/setting.20up.20regtest.2Faports-setup.2Esh/with/544318771
285 sudo mount \
286 -t overlay \
287 aports-package \
288 -o "$overlay_opts" \
289 -o index=off \
290 $merged
291
292 local -a prefix
293 if test -n "${XARGS_SLOT:-}"; then
294 local x=$XARGS_SLOT
295
296 # run slot 0 on cores 0 and 1
297 # run slot 9 on cores 18 and 19
298 local cores="$(( x*2 )),$(( x*2 + 1 ))"
299
300 # oversubscribe
301 # run slot 0 on cores 0 and 1
302 # run slot 19 on cores 19 and 0
303 #local cores="$(( x )),$(( (x + 1) % NUM_CORES ))"
304 prefix=( taskset -c "$cores" )
305 fi
306
307 "${prefix[@]}" $merged/enter-chroot -u udu sh -c '
308 cd oils
309
310 # show the effect of the overlay
311 #ls -l /bin/sh
312
313 regtest/aports-guest.sh build-one-package "$@"
314 ' dummy0 "$pkg" "$a_repo" "$xargs_slot"
315
316 if test -n "$INTERACTIVE"; then
317 echo "Starting interactive shell in overlayfs environment for package $a_repo/$pkg"
318 echo "Rebuild: abuild -f -r -C ~/aports/$a_repo/$pkg -k -K"
319 echo " Help: abuild -h"
320 # If the last command in the child shell exited non-zero then ctrl-d/exit
321 # will report that error code to the parent. If we don't ignore that error
322 # we will exit early and leave the package overlay mounted.
323 set +o errexit
324 $merged/enter-chroot -u udu
325 set -o errexit
326 fi
327
328 unmount-loop $merged
329}
330
331build-pkg() {
332 ### trivial wrapper around build-package-overlayfs - change arg order for xargs
333 local config=${1:-baseline}
334 local a_repo=${2:-main}
335 local pkg=${3:-lua5.4}
336
337 build-package-overlayfs "$config" "$pkg" "$a_repo"
338
339 # TODO:
340 # - we should only do this after we've done BOTH configs, so it appears
341 # atomically
342 save-package-files $config $a_repo $pkg
343
344 # TODO: blow away the layer dir, since we saved the "tombstone".
345 # We're not doing this now because we're still reporting off DEPRECATED shard
346 # files.
347}
348
349LOG_SIZE_THRESHOLD=$(( 500 * 1000 )) # 500 KB
350#LOG_SIZE_THRESHOLD=$(( 1 * 1000 ))
351
352abridge-one-log() {
353 local src=$1
354 local dest=$2
355
356 local size
357 size=$(stat --format '%s' $src)
358 if test $size -lt $LOG_SIZE_THRESHOLD; then
359 #cp --verbose $src $dest
360 cp $src $dest
361 else
362 # Bug fix: abridging to 1000 lines isn't sufficient. We got some logs
363 # that were hundreds of MB, with less than 1000 lines!
364 { echo "*** This log is abridged to its last $LOG_SIZE_THRESHOLD bytes"
365 echo
366 tail --bytes $LOG_SIZE_THRESHOLD $src
367 } > $dest
368 fi
369}
370
371# save-package-files creates a tree we can rsync
372# For EACH PACKAGE, without shards
373#
374# TODO: Both baseline and osh-as-sh should appear atomically?
375
376# Source tree:
377#
378# _chroot/package-layers/
379# baseline/
380# jq/
381# home/udu/
382# oils/_tmp/aports-guest/
383# jq.log.txt
384# jq.task.tsv
385# packages/main/x86_64
386# jq-*.apk
387# aports/main/jq/
388# src/jq-1.8.0/test-suite.log
389#
390# _tmp/aports-build/
391# 2025-11-12/
392# shard0/ # TODO: remove shards
393# baseline/
394# NEW:
395# apk/
396# jq.apk.txt # md5sum
397# layer/
398# jq.tombstone.txt # find '%s %P\n'
399# task/
400# jq.task.tsv
401# EXISTING:
402# apk.txt
403# tasks.tsv
404# log/
405# jq.log.txt
406# test-suite/
407# jq/ TODO: support multiple logs
408# test-suite.log
409
410save-package-files() {
411 ### Copy some files from _chroot/package-layers/ -> _tmp/aports-build
412
413 local config=${1:-baseline}
414 local a_repo=${2:-main}
415 local pkg=${3:-jq}
416
417 local layer_dir=_chroot/package-layers/$config/$pkg
418 local dest_dir=$BASE_DIR/$APORTS_EPOCH/$config
419
420 # 5 directories
421 mkdir -p $dest_dir/{apk,layer,task,log,test-suite}
422
423 cp \
424 $layer_dir/home/udu/oils/_tmp/aports-guest/$pkg.task.tsv \
425 $dest_dir/task
426
427 abridge-one-log \
428 $layer_dir/home/udu/oils/_tmp/aports-guest/$pkg.log.txt \
429 $dest_dir/log/$pkg.log.txt
430
431 # Abridge this log too
432 { find $layer_dir/home/udu/aports/$a_repo/$pkg -name 'test-suite.log' 2> /dev/null || true; } |
433 while read -r log_src; do
434 local test_suite_dest_dir=$dest_dir/test-suite/$pkg
435 mkdir -p $test_suite_dest_dir
436 abridge-one-log \
437 $log_src \
438 $test_suite_dest_dir/test-suite.log.txt
439 done
440
441 md5sum $layer_dir/home/udu/packages/$a_repo/x86_64/*.apk \
442 > $dest_dir/apk/$pkg.apk.txt 2> /dev/null || true # allow failure if nothing built
443
444 # Truncate large listings - e.g. clang packages have over 120K files
445 { find $layer_dir -printf '%s %P\n' 2> /dev/null || true; } |
446 head -n 1000 > $dest_dir/layer/$pkg.tombstone.txt
447
448 #tree $dest_dir
449
450 # log.txt
451 # log.txt
452}
453
454NUM_CORES=$(( $(nproc) ))
455
456# 2 cores per package build
457NUM_PAR=$(( NUM_CORES / 2 ))
458
459# over-subscribe - allow 20 processes to see 2 cores each
460# Note: this causes more timeouts. TODO: get rid of shards to get rid of
461# stragglers, and then raise the timeout to 20 minutes or more.
462# NUM_PAR=$(( NUM_CORES ))
463
464# TODO: we ran into the env.sh race condition in the enter-chroot script
465# generated by alpine-chroot-install
466build-many-packages-overlayfs() {
467 local package_filter=${1:-}
468 local config=${2:-baseline}
469 local a_repo=${3:-main}
470 local parallel=${4:-T}
471
472 banner "Building packages (filter=$package_filter a_repo=$a_repo)"
473
474 local -a flags
475 if test -n "$parallel"; then
476 log "(with $NUM_PAR jobs in parallel)"
477 flags=( -P $NUM_PAR )
478 else
479 log '(serially)'
480 fi
481
482 package-dirs "$package_filter" $a_repo |
483 xargs "${flags[@]}" -n 1 --process-slot-var=XARGS_SLOT -- \
484 $0 build-pkg $config $a_repo
485}
486
487
488clean-host-and-guest() {
489 # host dir _tmp/aports-build
490 rm -r -f -v $BASE_DIR
491}
492
493clean-guest() {
494 # clean guest chroot
495 sudo rm -r -f -v $CHROOT_HOME_DIR/oils/_tmp
496}
497
498readonly -a CONFIGS=( baseline osh-as-sh )
499
500APORTS_EPOCH="${APORTS_EPOCH:-}"
501# default epoch
502if test -z "$APORTS_EPOCH"; then
503 APORTS_EPOCH=$(date '+%Y-%m-%d')
504fi
505
506_build-many-configs-overlayfs() {
507 local package_filter=${1:-}
508 local epoch=${2:-$APORTS_EPOCH}
509 local a_repo=${3:-main}
510
511 if test -z "$package_filter"; then
512 die "Package filter is required (e.g. shard3, ALL)"
513 fi
514
515 clean-guest
516
517 # See note about /etc/sudoers.d at top of file
518
519 local dest_dir="$BASE_DIR/$epoch/$package_filter" # e.g. shard10
520
521 for config in "${CONFIGS[@]}"; do
522 banner "$epoch: Using config $config"
523
524 build-many-packages-overlayfs "$package_filter" "$config" "$a_repo"
525 done
526}
527
528remove-shard-files() {
529 local shard_dir=${1:-_chroot/shardC}
530
531 # For all packages packages, for baseline and osh-as-sh, clean up the aports source dir
532 # For linux, clang, etc. it becomes MANY GIGABYTES
533 #
534 # 2025-09-12: ignore errors from rm; I think there was a race condition -
535 # processes could still be running and creating files
536 #
537 # rm: cannot remove '_chroot/shard6/baseline/llvm19/home/udu/aports/main/llvm19/src/llvm-project-19.1.7.src/build/lib': Directory not empty
538 # real 1041m46.464s
539
540 #log "Removing big files in shard $shard_dir"
541 #sudo rm -r -f $shard_dir/*/*/home/udu/aports/ || true
542
543 log "Removing all files in $shard_dir"
544 sudo rm -r -f $shard_dir || true
545}
546
547build-many-shards-overlayfs() {
548 sudo -k
549
550 local a_repo=${A_REPO:-main} # env var like $APORTS_EPOCH
551
552 # Clean up old runs
553 sudo rm -r -f _chroot/package-layers _chroot/shard* _chroot/disagree*
554
555 banner "$APORTS_EPOCH $a_repo: building shards: $*"
556
557 time for shard_name in "$@"; do
558 _build-many-configs-overlayfs "$shard_name" "$APORTS_EPOCH" "$a_repo"
559
560 # Move layer files to _chroot/shard10/{baseline,osh}/...
561 mv -v --no-target-directory _chroot/package-layers _chroot/$shard_name
562
563 # Make it rsync-able in _tmp/aports-build ($BASE_DIR)
564 make-shard-tree $shard_name $a_repo
565
566 # Remove big files
567 remove-shard-files _chroot/$shard_name
568
569 # TODO: we should publish and clean up after every PACKAGE, rather than
570 # each shard
571 done
572}
573
574build-and-proc-log() {
575 # Measure resource utilization
576 local proc_dir="$BASE_DIR/$APORTS_EPOCH/proc-log"
577 mkdir -v -p $proc_dir
578 regtest/proc_log.py --out-dir $proc_dir --sleep-secs 5 &
579 local proc_log_pid=$!
580
581 sleep 0.05 # prevent overlapping sudo prompt
582
583 build-many-shards-overlayfs "$@"
584
585 kill -s TERM $proc_log_pid
586 wc -l $proc_dir/*.txt
587}
588
589make-shard-tree() {
590 ### Put outputs in rsync-able format, for a SINGLE shard
591
592 # The dir structure is like this:
593 #
594 # _tmp/aports-build/
595 # 2025-09-10-overlayfs/
596 # shard0/
597 # baseline/
598 # apk.txt
599 # tasks.tsv
600 # log/
601 # gzip.log.txt
602 # xz.log.txt
603 # test-suite/ # autotools dir
604 # gzip/
605 # test-suite.log.txt
606 # osh-as-sh/
607 # apk.txt
608 # tasks.tsv
609 # log/
610 # gzip.log.txt
611 # xz.log.txt
612 # test-suite/
613 # gzip/
614 # test-suite.log.txt
615 # shard1/
616 # ...
617 # shard16/
618 # ...
619
620 local shard_name=$1
621 local a_repo=${2:-main}
622 local epoch=${3:-$APORTS_EPOCH}
623
624 local shard_dir=_chroot/$shard_name
625
626 for config in baseline osh-as-sh; do
627 local dest_dir=$BASE_DIR/$epoch/$shard_name/$config
628 mkdir -p $dest_dir
629 #ls -l $shard_dir/$config
630
631 # Four outputs
632 # 1) log.txt for each package
633 # 2) Optional test-suite.txt for each package
634 # 3) merged tasks.tsv
635 # - comes from .task.tsv
636 # 4) merged apk.txt
637 #
638 # So 3 and 4 should not be merged yet
639 #
640 # _tmp/aports-build/
641 # 2025-11-12/
642 # shardP/
643 # baseline/
644 # log/
645 # test-suite/
646 # apk.txt
647 # tasks.tsv
648 #
649 # We want to
650
651 time python3 devtools/tsv_concat.py \
652 $shard_dir/$config/*/home/udu/oils/_tmp/aports-guest/*.task.tsv > $dest_dir/tasks.tsv
653
654 # Allowed to fail if zero .apk are built
655 time md5sum $shard_dir/$config/*/home/udu/packages/$a_repo/x86_64/*.apk \
656 > $dest_dir/apk.txt 2> /dev/null || true
657
658 abridge-logs $shard_dir/$config $dest_dir
659
660 done
661}
662
663abridge-logs() {
664 local config_src_dir=${1:-_chroot/shardD/osh-as-sh}
665 local dest_dir=${2:-$BASE_DIR/shardD/osh-as-sh}
666
667 local log_dest_dir=$dest_dir/log
668 local test_suite_dest_dir=$dest_dir/test-suite
669 mkdir -p $log_dest_dir $test_suite_dest_dir
670
671 local threshold=$(( 500 * 1000 )) # 500 KB
672
673 # this assumes the build process doesn't create *.log.txt
674 # test-suite.log is the name used by the autotools test runner - we want to save those too
675 # ignore permission errors with || true
676 { find $config_src_dir -name '*.log.txt' -a -printf '%s\t%P\n' 2> /dev/null || true; } |
677 while read -r size path; do
678 local src=$config_src_dir/$path
679 # Remove text until last slash (shortest match)
680 # like $(basename $path) but in bash, for speed
681 local filename=${path##*/}
682 local dest=$log_dest_dir/$filename
683
684 if test "$size" -lt "$threshold"; then
685 cp -v $src $dest
686 else
687 # Bug fix: abriding to 1000 lines isn't sufficient. We got some logs
688 # that were hundreds of MB, with less than 1000 lines!
689 { echo "*** This log is abridged to its last 500 KB:"
690 echo
691 tail --bytes 500000 $src
692 } > $dest
693 fi
694 done
695
696 { find $config_src_dir -name 'test-suite.log' -a -printf '%P\n' 2> /dev/null || true; } |
697 while read -r path; do
698 local src=$config_src_dir/$path
699
700 # Remove text after the first slash (shortest match)
701 local package_name=${path%%/*}
702 local dest=$test_suite_dest_dir/$package_name/test-suite.log.txt
703
704 mkdir -p "$(dirname $dest)"
705 cp -v --no-target-directory $src $dest
706 done
707
708 # 500K threshold: 76 MB
709 du --si -s $log_dest_dir
710}
711
712demo-build() {
713 local pkg=${1:-gzip} # in shardA, uses many cores
714 local do_pin=${2:-}
715
716 local -a prefix
717 if test -n "$do_pin"; then
718 echo "*** Pinning to CPU 0 ***"
719 prefix=( taskset -c 0 )
720 fi
721
722 "${prefix[@]}" $CHROOT_DIR/enter-chroot -u udu sh -c '
723 pkg=$1
724
725 echo "nproc = $(nproc)"
726
727 cd oils
728 set -x
729
730 # Note the user / real ratio! How many cores did we use?
731 time regtest/aports-guest.sh build-one-package $pkg
732 ' dummy0 $pkg
733}
734
735test-taskset() {
736 local pkg=${1:-gzip} # in shardA, uses many cores
737
738 demo-build $pkg ''
739 demo-build $pkg T
740}
741
742test-proc-log() {
743 local out_dir=_tmp/proc-log
744 mkdir -p $out_dir
745
746 regtest/proc_log.py --out-dir $out_dir &
747 local pid=$!
748 sleep 3.1 # should get 3 entries
749 kill $pid
750 wc -l $out_dir/*.txt
751}
752
753task-five "$@"