File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -26,11 +26,6 @@ plan +@files;
26
26
my $ max-jobs = % * ENV <TEST_THREADS > // 2 ;
27
27
my % output ;
28
28
29
- sub test-promise ($ promise ) {
30
- my $ file = $ promise . command[* - 1 ];
31
- test-it(% output {$ file }, $ file );
32
- }
33
-
34
29
sub test-it (Str $ output , Str $ file ) {
35
30
my $ ok = True ;
36
31
@@ -76,15 +71,18 @@ for @files -> $file {
76
71
my $ a = Proc ::Async. new ($ * EXECUTABLE-NAME , ' --doc' , $ file );
77
72
% output {$ file } = ' ' ;
78
73
$ a . stdout. tap (-> $ buf { % output {$ file } = % output {$ file } ~ $ buf });
79
- push @ jobs : $ a . start;
80
- if + @ jobs > $ max-jobs {
81
- test-promise( await @ jobs . shift )
82
- }
74
+ push @ jobs : Promise . anyof(
75
+ $ a . start . then({ test-it( % output { $ file }, $ file ) }),
76
+ Promise . in( 60 )
77
+ );
83
78
} else {
84
- test-it($ file . IO . slurp , $ file );
79
+ push @ jobs : Promise . anyof(
80
+ start { test-it($ file . IO . slurp , $ file ) },
81
+ Promise . in(60 )
82
+ );
85
83
}
86
84
}
87
85
88
- for @ jobs . map : { await $ _ } -> $ r { test-promise( $ r ) }
86
+ await Promise . allof( @ jobs );
89
87
90
88
# vim: expandtab shiftwidth=4 ft=perl6
You can’t perform that action at this time.
0 commit comments