Skip to content

Commit d68a7ea

Browse files
authored
Merge pull request #1486 from elezar/update-stale-action
[no-relnote] Update GitHub action for marking issues and PRs as stale
2 parents 1bdf2f6 + a5e1bf4 commit d68a7ea

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

.github/workflows/stale.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ jobs:
1414
steps:
1515
- uses: actions/stale@v10
1616
with:
17-
stale-issue-message: 'This issue is stale because it has been open 90 days with no activity. This issue will be closed in 30 days unless new comments are made or the stale label is removed.'
18-
stale-pr-message: 'This PR is stale because it has been open 90 days with no activity. This PR will be closed in 30 days unless new comments are made or the stale label is removed.'
17+
stale-issue-message: 'This issue is stale because it has been open 90 days with no activity. This issue will be closed in 30 days unless new comments are made or the stale label is removed. To skip these checks, apply the "lifecycle/frozen" label.'
18+
stale-pr-message: 'This PR is stale because it has been open 90 days with no activity. This PR will be closed in 30 days unless new comments are made or the stale label is removed. To skip these checks, apply the "lifecycle/frozen" label.'
1919
stale-issue-label: 'lifecycle/stale'
2020
stale-pr-label: 'lifecycle/stale'
21+
exempt-issue-labels: 'lifecycle/frozen'
22+
exempt-pr-labels: 'lifecycle/frozen'
2123
days-before-stale: 90
2224
close-issue-message: 'This issue was automatically closed due to inactivity.'
23-
close-pr-message: 'This pull request was automatically closed due to inactivity.'
25+
close-pr-message: 'This pull request was automatically closed due to inactivity.'
2426
days-before-issue-close: 30
2527
days-before-pr-close: 30
2628
remove-stale-when-updated: true

cmd/gpu-feature-discovery/main_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,10 @@ func TestRunSleep(t *testing.T) {
249249
runRestart, runError = d.run(sigs)
250250
}()
251251

252-
outFileModificationTime := make([]int64, 2)
253-
timestampLabels := make([]string, 2)
252+
var outFileModificationTime []int64
253+
var timestampLabels []string
254254
// Read two iterations of the output file
255-
for i := 0; i < 2; i++ {
255+
for i := range 2 {
256256
outFile, err := waitForFile(*conf.Flags.GFD.OutputFile, 5, time.Second)
257257
require.NoErrorf(t, err, "Open output file: %d", i)
258258

@@ -266,13 +266,13 @@ func TestRunSleep(t *testing.T) {
266266
require.NoError(t, err, "Getting output file info")
267267

268268
ts = outFileStat.ModTime().Unix()
269-
if ts > outFileModificationTime[0] {
269+
if len(outFileModificationTime) == 0 || ts > outFileModificationTime[0] {
270270
break
271271
}
272272
// We wait for conf.SleepInterval, as the labels should be updated at least once in that period
273273
time.Sleep(time.Duration(*conf.Flags.GFD.SleepInterval))
274274
}
275-
outFileModificationTime[i] = ts
275+
outFileModificationTime = append(outFileModificationTime, ts)
276276

277277
output, err := io.ReadAll(outFile)
278278
require.NoErrorf(t, err, "Read output file: %d", i)
@@ -289,7 +289,7 @@ func TestRunSleep(t *testing.T) {
289289
require.NoErrorf(t, err, "Building map of labels from output file: %d", i)
290290

291291
require.Containsf(t, labels, "nvidia.com/gfd.timestamp", "Missing timestamp: %d", i)
292-
timestampLabels[i] = labels["nvidia.com/gfd.timestamp"]
292+
timestampLabels = append(timestampLabels, labels["nvidia.com/gfd.timestamp"])
293293

294294
require.Containsf(t, labels, "nvidia.com/vgpu.present", "Missing vgpu present label: %d", i)
295295
require.Containsf(t, labels, "nvidia.com/vgpu.host-driver-version", "Missing vGPU host driver version label: %d", i)

0 commit comments

Comments
 (0)