File tree 4 files changed +29
-22
lines changed
4 files changed +29
-22
lines changed Original file line number Diff line number Diff line change 7
7
- dev
8
8
paths-ignore :
9
9
- ' **.md'
10
- - ' .github/FUNDING.yml'
11
- - ' .github/release-drafter.yml'
12
- - ' .github/ISSUE_TEMPLATE/*'
13
- - ' .github/workflows/pull-request.yml'
14
- - ' .github/workflows/release-drafter.yml'
10
+ - ' **.yml'
11
+ - ' **.yaml'
12
+ - ' !.github/workflows/codeql.yml'
15
13
pull_request :
16
14
branches :
17
15
- master
18
16
- dev
19
17
paths-ignore :
20
18
- ' **.md'
21
- - ' .github/FUNDING.yml'
22
- - ' .github/release-drafter.yml'
23
- - ' .github/ISSUE_TEMPLATE/*'
24
- - ' .github/workflows/pull-request.yml'
25
- - ' .github/workflows/release-drafter.yml'
19
+ - ' **.yml'
20
+ - ' **.yaml'
21
+ - ' !.github/workflows/codeql.yml'
26
22
schedule :
27
23
# ┌───────────── minute (0 - 59)
28
24
# │ ┌───────────── hour (0 - 23)
Original file line number Diff line number Diff line change 7
7
- dev
8
8
paths-ignore :
9
9
- ' **.md'
10
- - ' .github/FUNDING.yml'
11
- - ' .github/release-drafter.yml'
12
- - ' .github/ISSUE_TEMPLATE/*'
13
- - ' .github/workflows/codeql.yml'
14
- - ' .github/workflows/pull-request.yml'
15
- - ' .github/workflows/release-drafter.yml'
10
+ - ' **.yml'
11
+ - ' **.yaml'
16
12
- ' examples/*'
13
+ - ' !.github/workflows/test.yml'
17
14
pull_request :
18
15
branches :
19
16
- master
20
17
- dev
21
18
paths-ignore :
22
19
- ' **.md'
23
- - ' .github/FUNDING.yml'
24
- - ' .github/release-drafter.yml'
25
- - ' .github/ISSUE_TEMPLATE/*'
26
- - ' .github/workflows/codeql.yml'
27
- - ' .github/workflows/pull-request.yml'
28
- - ' .github/workflows/release-drafter.yml'
20
+ - ' **.yml'
21
+ - ' **.yaml'
29
22
- ' examples/*'
23
+ - ' !.github/workflows/test.yml'
30
24
31
25
env :
32
26
GO111MODULE : on
Original file line number Diff line number Diff line change @@ -123,6 +123,11 @@ func Release() {
123
123
defaultAntsPool .Release ()
124
124
}
125
125
126
+ // ReleaseTimeout is like Release but with a timeout, it waits all workers to exit before timing out.
127
+ func ReleaseTimeout (timeout time.Duration ) error {
128
+ return defaultAntsPool .ReleaseTimeout (timeout )
129
+ }
130
+
126
131
// Reboot reboots the default pool.
127
132
func Reboot () {
128
133
defaultAntsPool .Reboot ()
Original file line number Diff line number Diff line change @@ -973,3 +973,15 @@ func TestReleaseTimeout(t *testing.T) {
973
973
err = pf .ReleaseTimeout (2 * time .Second )
974
974
assert .NoError (t , err )
975
975
}
976
+
977
+ func TestDefaultPoolReleaseTimeout (t * testing.T ) {
978
+ Reboot ()
979
+ for i := 0 ; i < 5 ; i ++ {
980
+ _ = Submit (func () {
981
+ time .Sleep (time .Second )
982
+ })
983
+ }
984
+ assert .NotZero (t , Running ())
985
+ err := ReleaseTimeout (2 * time .Second )
986
+ assert .NoError (t , err )
987
+ }
You can’t perform that action at this time.
0 commit comments