Skip to content

Commit 4ee41f6

Browse files
test: fixed flaky parallel tests
1 parent 7e1cd58 commit 4ee41f6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

marshaller/factory_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,10 @@ func TestRegisterType_Success(t *testing.T) {
129129
assert.Equal(t, "test", customInstance.Value)
130130
}
131131

132+
//nolint:paralleltest // Global state manipulation requires sequential execution
132133
func TestClearGlobalFieldCache_Success(t *testing.T) {
133-
t.Parallel()
134+
// Note: Not using t.Parallel() because this test manipulates global cache state
135+
// that could interfere with other parallel tests
134136

135137
// Define a test struct to build cache for
136138
type TestStruct struct {
@@ -156,8 +158,10 @@ func TestClearGlobalFieldCache_Success(t *testing.T) {
156158
assert.True(t, stats.Size < initialSize || initialSize == 0)
157159
}
158160

161+
//nolint:paralleltest // Global state manipulation requires sequential execution
159162
func TestGetFieldCacheStats_Success(t *testing.T) {
160-
t.Parallel()
163+
// Note: Not using t.Parallel() because this test manipulates global cache state
164+
// that could interfere with other parallel tests
161165

162166
// Clear cache first to get a clean state
163167
ClearGlobalFieldCache()

0 commit comments

Comments
 (0)