@@ -27,11 +27,15 @@ package host
27
27
import (
28
28
"bytes"
29
29
"encoding/binary"
30
+ "flag"
30
31
"fmt"
31
32
"strconv"
33
+ "testing"
32
34
"time"
33
35
34
36
"github.com/pborman/uuid"
37
+ "github.com/stretchr/testify/require"
38
+ "github.com/stretchr/testify/suite"
35
39
commandpb "go.temporal.io/api/command/v1"
36
40
commonpb "go.temporal.io/api/common/v1"
37
41
enumspb "go.temporal.io/api/enums/v1"
@@ -43,6 +47,7 @@ import (
43
47
44
48
"go.temporal.io/server/common"
45
49
"go.temporal.io/server/common/convert"
50
+ "go.temporal.io/server/common/dynamicconfig"
46
51
"go.temporal.io/server/common/log/tag"
47
52
"go.temporal.io/server/common/payloads"
48
53
"go.temporal.io/server/common/persistence"
@@ -54,7 +59,33 @@ const (
54
59
retryBackoffTime = 500 * time .Millisecond
55
60
)
56
61
57
- func (s * integrationSuite ) TestArchival_TimerQueueProcessor () {
62
+ type archivalSuite struct {
63
+ * require.Assertions
64
+ IntegrationBase
65
+ }
66
+
67
+ func (s * archivalSuite ) SetupSuite () {
68
+ s .dynamicConfigOverrides = map [dynamicconfig.Key ]interface {}{
69
+ dynamicconfig .RetentionTimerJitterDuration : time .Second ,
70
+ }
71
+ s .setupSuite ("testdata/integration_test_cluster.yaml" )
72
+ }
73
+
74
+ func (s * archivalSuite ) TearDownSuite () {
75
+ s .tearDownSuite ()
76
+ }
77
+
78
+ func (s * archivalSuite ) SetupTest () {
79
+ // Have to define our overridden assertions in the test setup. If we did it earlier, s.T() will return nil
80
+ s .Assertions = require .New (s .T ())
81
+ }
82
+
83
+ func TestArchivalSuite (t * testing.T ) {
84
+ flag .Parse ()
85
+ suite .Run (t , new (archivalSuite ))
86
+ }
87
+
88
+ func (s * archivalSuite ) TestArchival_TimerQueueProcessor () {
58
89
s .True (s .testCluster .archiverBase .metadata .GetHistoryConfig ().ClusterConfiguredForArchival ())
59
90
60
91
namespaceID := s .getNamespaceID (s .archivalNamespace )
@@ -74,7 +105,7 @@ func (s *integrationSuite) TestArchival_TimerQueueProcessor() {
74
105
s .True (s .isMutableStateDeleted (namespaceID , execution ))
75
106
}
76
107
77
- func (s * integrationSuite ) TestArchival_ContinueAsNew () {
108
+ func (s * archivalSuite ) TestArchival_ContinueAsNew () {
78
109
s .True (s .testCluster .archiverBase .metadata .GetHistoryConfig ().ClusterConfiguredForArchival ())
79
110
80
111
namespaceID := s .getNamespaceID (s .archivalNamespace )
@@ -96,7 +127,7 @@ func (s *integrationSuite) TestArchival_ContinueAsNew() {
96
127
}
97
128
}
98
129
99
- func (s * integrationSuite ) TestArchival_ArchiverWorker () {
130
+ func (s * archivalSuite ) TestArchival_ArchiverWorker () {
100
131
s .T ().SkipNow () // flaky test, skip for now, will reimplement archival feature.
101
132
102
133
s .True (s .testCluster .archiverBase .metadata .GetHistoryConfig ().ClusterConfiguredForArchival ())
@@ -117,7 +148,7 @@ func (s *integrationSuite) TestArchival_ArchiverWorker() {
117
148
s .True (s .isMutableStateDeleted (namespaceID , execution ))
118
149
}
119
150
120
- func (s * integrationSuite ) TestVisibilityArchival () {
151
+ func (s * archivalSuite ) TestVisibilityArchival () {
121
152
s .True (s .testCluster .archiverBase .metadata .GetVisibilityConfig ().ClusterConfiguredForArchival ())
122
153
123
154
namespaceID := s .getNamespaceID (s .archivalNamespace )
@@ -170,7 +201,7 @@ func (s *IntegrationBase) getNamespaceID(namespace string) string {
170
201
return namespaceResp .NamespaceInfo .GetId ()
171
202
}
172
203
173
- func (s * integrationSuite ) isHistoryArchived (namespace string , execution * commonpb.WorkflowExecution ) bool {
204
+ func (s * archivalSuite ) isHistoryArchived (namespace string , execution * commonpb.WorkflowExecution ) bool {
174
205
request := & workflowservice.GetWorkflowExecutionHistoryRequest {
175
206
Namespace : s .archivalNamespace ,
176
207
Execution : execution ,
@@ -186,7 +217,7 @@ func (s *integrationSuite) isHistoryArchived(namespace string, execution *common
186
217
return false
187
218
}
188
219
189
- func (s * integrationSuite ) isHistoryDeleted (execution * commonpb.WorkflowExecution ) bool {
220
+ func (s * archivalSuite ) isHistoryDeleted (execution * commonpb.WorkflowExecution ) bool {
190
221
namespaceID := s .getNamespaceID (s .archivalNamespace )
191
222
shardID := common .WorkflowIDToHistoryShard (namespaceID , execution .GetWorkflowId (),
192
223
s .testClusterConfig .HistoryConfig .NumHistoryShards )
@@ -205,7 +236,7 @@ func (s *integrationSuite) isHistoryDeleted(execution *commonpb.WorkflowExecutio
205
236
return false
206
237
}
207
238
208
- func (s * integrationSuite ) isMutableStateDeleted (namespaceID string , execution * commonpb.WorkflowExecution ) bool {
239
+ func (s * archivalSuite ) isMutableStateDeleted (namespaceID string , execution * commonpb.WorkflowExecution ) bool {
209
240
shardID := common .WorkflowIDToHistoryShard (namespaceID , execution .GetWorkflowId (),
210
241
s .testClusterConfig .HistoryConfig .NumHistoryShards )
211
242
request := & persistence.GetWorkflowExecutionRequest {
@@ -225,7 +256,7 @@ func (s *integrationSuite) isMutableStateDeleted(namespaceID string, execution *
225
256
return false
226
257
}
227
258
228
- func (s * integrationSuite ) startAndFinishWorkflow (id , wt , tq , namespace , namespaceID string , numActivities , numRuns int ) []string {
259
+ func (s * archivalSuite ) startAndFinishWorkflow (id , wt , tq , namespace , namespaceID string , numActivities , numRuns int ) []string {
229
260
identity := "worker1"
230
261
activityName := "activity_type1"
231
262
workflowType := & commonpb.WorkflowType {
0 commit comments