Skip to content

Commit d668287

Browse files
committed
ci: More fixes
1 parent 960fd63 commit d668287

5 files changed

Lines changed: 6 additions & 5 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
run: go vet ./...
5454
- name: Staticcheck
5555
run: |
56-
go install honnef.co/go/tools/cmd/staticcheck@v0.8.1
56+
go install honnef.co/go/tools/cmd/staticcheck@v0.8.2
5757
staticcheck ./...
5858
- name: Vulnerability scan
5959
run: |

‎chain/management_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func newManagementFixture(t *testing.T) *managementFixture {
149149
f.simulationHook(input.From, input.To, input.Data, input.Value)
150150
}
151151
if f.failSimulation == method.Name {
152-
http.Error(w, "unavailable", 503)
152+
http.Error(w, "unavailable", http.StatusServiceUnavailable)
153153
return
154154
}
155155
// All staking hints must be prepared from the already confirmed state.

‎signer/kafka.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ func (c KafkaConfig) Validate() error {
7676
return errors.New("--kafka-outbox-max-bytes must be positive")
7777
}
7878
if (c.Username == "") != (c.Password == "") || (c.UsernameFile != "" || c.PasswordFile != "") && (c.Username == "" || c.Password == "") {
79-
return errors.New("Kafka username and password must be supplied together: set LIVEPEER_SIGNER_KAFKA_USERNAME and LIVEPEER_SIGNER_KAFKA_PASSWORD, or use --kafka-username-file and --kafka-password-file")
79+
return errors.New("kafka username and password must be supplied together: set LIVEPEER_SIGNER_KAFKA_USERNAME and LIVEPEER_SIGNER_KAFKA_PASSWORD, or use --kafka-username-file and --kafka-password-file")
8080
}
8181
if strings.ContainsRune(c.Username, 0) || strings.ContainsRune(c.Password, 0) {
82-
return errors.New("Kafka credentials must not contain NUL bytes; check LIVEPEER_SIGNER_KAFKA_USERNAME or --kafka-username-file and LIVEPEER_SIGNER_KAFKA_PASSWORD or --kafka-password-file")
82+
return errors.New("kafka credentials must not contain NUL bytes; check LIVEPEER_SIGNER_KAFKA_USERNAME or --kafka-username-file and LIVEPEER_SIGNER_KAFKA_PASSWORD or --kafka-password-file")
8383
}
8484
_, err := c.transport()
8585
return err

‎signer/outbox.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,10 @@ func (o *eventOutbox) enqueue(ctx context.Context, event signingEvent) (count in
154154
return 0, err
155155
}
156156
if inserted, _ := result.RowsAffected(); inserted == 0 {
157+
// Not ready until enough space is available.
157158
o.capacityNeeded.Store(int64(len(payload)))
158159
return 0, errOutboxFull
159160
}
160-
o.capacityNeeded.Store(0)
161161
return stats.Count, nil
162162
}
163163

‎signer/outbox_test.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ func TestOutboxCapacityConcurrentAdmissionAndRecovery(t *testing.T) {
155155
require.NoError(t, p.outbox.acknowledge(t.Context(), pending[:1]))
156156
require.True(t, p.ready(t.Context()))
157157
require.NoError(t, p.Enqueue(t.Context(), testEvent()))
158+
require.False(t, p.ready(t.Context()))
158159
require.Equal(t, uint64(9), p.enqueueFailures.Load())
159160
var metrics bytes.Buffer
160161
p.metrics(t.Context(), &metrics)

0 commit comments

Comments
 (0)