mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-14 14:02:41 +00:00
Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367)
Some checks failed
/ release (push) Waiting to run
testing / backend-checks (push) Has been skipped
testing / frontend-checks (push) Has been skipped
testing / test-unit (push) Has been skipped
testing / test-e2e (push) Has been skipped
testing / test-mysql (push) Has been skipped
testing / test-pgsql (push) Has been skipped
testing / test-sqlite (push) Has been skipped
testing / test-remote-cacher (redis) (push) Has been skipped
testing / test-remote-cacher (valkey) (push) Has been skipped
testing / test-remote-cacher (garnet) (push) Has been skipped
testing / test-remote-cacher (redict) (push) Has been skipped
testing / security-check (push) Has been skipped
Integration tests for the release process / release-simulation (push) Has been cancelled
Some checks failed
/ release (push) Waiting to run
testing / backend-checks (push) Has been skipped
testing / frontend-checks (push) Has been skipped
testing / test-unit (push) Has been skipped
testing / test-e2e (push) Has been skipped
testing / test-mysql (push) Has been skipped
testing / test-pgsql (push) Has been skipped
testing / test-sqlite (push) Has been skipped
testing / test-remote-cacher (redis) (push) Has been skipped
testing / test-remote-cacher (valkey) (push) Has been skipped
testing / test-remote-cacher (garnet) (push) Has been skipped
testing / test-remote-cacher (redict) (push) Has been skipped
testing / security-check (push) Has been skipped
Integration tests for the release process / release-simulation (push) Has been cancelled
Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org> Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
This commit is contained in:
parent
51ff4970ec
commit
fed2d81c44
427 changed files with 2043 additions and 2046 deletions
|
@ -64,9 +64,9 @@ func TestWorkerPoolQueueUnhandled(t *testing.T) {
|
|||
ok := true
|
||||
for i := 0; i < queueSetting.Length; i++ {
|
||||
if i%2 == 0 {
|
||||
ok = ok && assert.EqualValues(t, 2, m[i], "test %s: item %d", t.Name(), i)
|
||||
ok = ok && assert.Equal(t, 2, m[i], "test %s: item %d", t.Name(), i)
|
||||
} else {
|
||||
ok = ok && assert.EqualValues(t, 1, m[i], "test %s: item %d", t.Name(), i)
|
||||
ok = ok && assert.Equal(t, 1, m[i], "test %s: item %d", t.Name(), i)
|
||||
}
|
||||
}
|
||||
if !ok {
|
||||
|
@ -174,7 +174,7 @@ func testWorkerPoolQueuePersistence(t *testing.T, queueSetting setting.QueueSett
|
|||
|
||||
assert.NotEmpty(t, tasksQ1)
|
||||
assert.NotEmpty(t, tasksQ2)
|
||||
assert.EqualValues(t, testCount, len(tasksQ1)+len(tasksQ2))
|
||||
assert.Equal(t, testCount, len(tasksQ1)+len(tasksQ2))
|
||||
}
|
||||
|
||||
func TestWorkerPoolQueueActiveWorkers(t *testing.T) {
|
||||
|
@ -192,13 +192,13 @@ func TestWorkerPoolQueueActiveWorkers(t *testing.T) {
|
|||
}
|
||||
|
||||
time.Sleep(50 * time.Millisecond)
|
||||
assert.EqualValues(t, 1, q.GetWorkerNumber())
|
||||
assert.EqualValues(t, 1, q.GetWorkerActiveNumber())
|
||||
assert.Equal(t, 1, q.GetWorkerNumber())
|
||||
assert.Equal(t, 1, q.GetWorkerActiveNumber())
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
assert.EqualValues(t, 1, q.GetWorkerNumber())
|
||||
assert.EqualValues(t, 0, q.GetWorkerActiveNumber())
|
||||
assert.Equal(t, 1, q.GetWorkerNumber())
|
||||
assert.Equal(t, 0, q.GetWorkerActiveNumber())
|
||||
time.Sleep(workerIdleDuration)
|
||||
assert.EqualValues(t, 1, q.GetWorkerNumber()) // there is at least one worker after the queue begins working
|
||||
assert.Equal(t, 1, q.GetWorkerNumber()) // there is at least one worker after the queue begins working
|
||||
stop()
|
||||
|
||||
q, _ = newWorkerPoolQueueForTest("test-workpoolqueue", setting.QueueSettings{Type: "channel", BatchLength: 1, MaxWorkers: 3, Length: 100}, handler, false)
|
||||
|
@ -208,13 +208,13 @@ func TestWorkerPoolQueueActiveWorkers(t *testing.T) {
|
|||
}
|
||||
|
||||
time.Sleep(50 * time.Millisecond)
|
||||
assert.EqualValues(t, 3, q.GetWorkerNumber())
|
||||
assert.EqualValues(t, 3, q.GetWorkerActiveNumber())
|
||||
assert.Equal(t, 3, q.GetWorkerNumber())
|
||||
assert.Equal(t, 3, q.GetWorkerActiveNumber())
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
assert.EqualValues(t, 3, q.GetWorkerNumber())
|
||||
assert.EqualValues(t, 0, q.GetWorkerActiveNumber())
|
||||
assert.Equal(t, 3, q.GetWorkerNumber())
|
||||
assert.Equal(t, 0, q.GetWorkerActiveNumber())
|
||||
time.Sleep(workerIdleDuration)
|
||||
assert.EqualValues(t, 1, q.GetWorkerNumber()) // there is at least one worker after the queue begins working
|
||||
assert.Equal(t, 1, q.GetWorkerNumber()) // there is at least one worker after the queue begins working
|
||||
stop()
|
||||
}
|
||||
|
||||
|
@ -241,13 +241,13 @@ func TestWorkerPoolQueueShutdown(t *testing.T) {
|
|||
}
|
||||
<-handlerCalled
|
||||
time.Sleep(200 * time.Millisecond) // wait for a while to make sure all workers are active
|
||||
assert.EqualValues(t, 4, q.GetWorkerActiveNumber())
|
||||
assert.Equal(t, 4, q.GetWorkerActiveNumber())
|
||||
stop() // stop triggers shutdown
|
||||
assert.EqualValues(t, 0, q.GetWorkerActiveNumber())
|
||||
assert.Equal(t, 0, q.GetWorkerActiveNumber())
|
||||
|
||||
// no item was ever handled, so we still get all of them again
|
||||
q, _ = newWorkerPoolQueueForTest("test-workpoolqueue", qs, handler, false)
|
||||
assert.EqualValues(t, 20, q.GetQueueItemNumber())
|
||||
assert.Equal(t, 20, q.GetQueueItemNumber())
|
||||
}
|
||||
|
||||
func TestWorkerPoolQueueWorkerIdleReset(t *testing.T) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue