Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2022-12-29 08:10:01 +0300
committerStan Hu <stanhu@gmail.com>2022-12-29 08:13:01 +0300
commitf9d1e41cbe94821c4a17700c68a712e15662575b (patch)
tree149367f03ef263d24e4f33ec9e71e87a4ab8f9e0
parentaf491dee74c5a3ec4e9000c77ecd226ec51e64d4 (diff)
Test for 64-bit alignment errorssh-fix-64-bit-atomic-alignment-try2
-rw-r--r--.gitlab-ci.yml19
-rw-r--r--internal/git/catfile/request_queue.go8
-rw-r--r--internal/git/catfile/request_queue_test.go5
3 files changed, 28 insertions, 4 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 061d73052..27f909d5b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -327,6 +327,25 @@ test:fips:
- if: $CI_MERGE_REQUEST_LABELS =~ /FIPS/
- *rules_run_on_merge
+test:raspberry-pi:
+ <<: *test_definition
+ image: registry.gitlab.com/gitlab-org/gitlab-omnibus-builder/rpi_11:4.0.0
+ needs: []
+ stage: test
+ cache:
+ - <<: *cache_deps_configuration
+ policy: pull-push
+ - <<: *cache_gems_configuration
+ policy: pull-push
+ - <<: *cache_go_configuration
+ policy: pull-push
+ variables:
+ <<: *test_variables
+ CACHE_PREFIX: raspberry-pi-11
+ parallel:
+ matrix:
+ - GO_VERSION: "1.19"
+
test:macos:
image: macos-12-xcode-14
tags:
diff --git a/internal/git/catfile/request_queue.go b/internal/git/catfile/request_queue.go
index e44d9d23f..a0335e8fc 100644
--- a/internal/git/catfile/request_queue.go
+++ b/internal/git/catfile/request_queue.go
@@ -27,10 +27,6 @@ const (
)
type requestQueue struct {
- // objectHash is the object hash used by the repository the request queue has been
- // spawned for.
- objectHash git.ObjectHash
-
// outstandingRequests is the number of requests which have been queued up. Gets incremented
// on request, and decremented when starting to read an object (not when that object has
// been fully consumed).
@@ -45,6 +41,10 @@ type requestQueue struct {
// isReadingObject indicates whether there is a read in progress.
isReadingObject int32
+ // objectHash is the object hash used by the repository the request queue has been
+ // spawned for.
+ objectHash git.ObjectHash
+
// isObjectQueue is set to `true` when this is a request queue which can be used for reading
// objects. If set to `false`, then this can only be used to read object info.
isObjectQueue bool
diff --git a/internal/git/catfile/request_queue_test.go b/internal/git/catfile/request_queue_test.go
index 84dbfad41..cdb381465 100644
--- a/internal/git/catfile/request_queue_test.go
+++ b/internal/git/catfile/request_queue_test.go
@@ -7,6 +7,7 @@ import (
"os"
"strings"
"testing"
+ "unsafe"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly/v15/internal/git"
@@ -404,6 +405,10 @@ func TestRequestQueue_RequestInfo(t *testing.T) {
})
}
+func TestRequestQueueCounters64BitAlignment(t *testing.T) {
+ require.Equal(t, 0, int(unsafe.Sizeof(requestQueue{}))%8)
+}
+
func newInterceptedObjectQueue(t *testing.T, ctx context.Context, script string) (ObjectContentReader, *requestQueue) {
cfg := testcfg.Build(t)
repo, _ := gittest.CreateRepository(t, ctx, cfg, gittest.CreateRepositoryConfig{