diff options
author | Stan Hu <stanhu@gmail.com> | 2022-12-29 08:10:01 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2022-12-29 08:13:01 +0300 |
commit | f9d1e41cbe94821c4a17700c68a712e15662575b (patch) | |
tree | 149367f03ef263d24e4f33ec9e71e87a4ab8f9e0 | |
parent | af491dee74c5a3ec4e9000c77ecd226ec51e64d4 (diff) |
Test for 64-bit alignment errorssh-fix-64-bit-atomic-alignment-try2
-rw-r--r-- | .gitlab-ci.yml | 19 | ||||
-rw-r--r-- | internal/git/catfile/request_queue.go | 8 | ||||
-rw-r--r-- | internal/git/catfile/request_queue_test.go | 5 |
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{ |