metadata_persistence_v2.go ×2

Frontier kind: Code frontier

unlabeled · c_8cfac42786f9

7 tests · 4374 LOC · 182 files · introduces 0 tests · 107 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
2 ranges107 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
779 ranges4374 lines · 182 files · Browse complete extent
All tests (intent)
7 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 107 introduced LOC across 2 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/persistence/persistence-tests/metadata_persistence_v2.go 107 introduced LOC · 2 ranges

Open complete file

1086
1087 // TestDeleteNamespace test
1088 > func (m *MetadataPersistenceSuiteV2) TestDeleteNamespace() { metadata_persistence_v2.go
1089 > id := uuid.NewString()
1090 > name := "delete-namespace-test-name"
1091 > state := enumspb.NAMESPACE_STATE_REGISTERED
1092 > description := "delete-namespace-test-description"
1093 > owner := "delete-namespace-test-owner"
1094 > data := map[string]string{"k1": "v1"}
1095 > retention := timestamp.DurationFromDays(10)
1096 > historyArchivalState := enumspb.ARCHIVAL_STATE_ENABLED
1097 > historyArchivalURI := "test://history/uri"
1098 > visibilityArchivalState := enumspb.ARCHIVAL_STATE_ENABLED
1099 > visibilityArchivalURI := "test://visibility/uri"
1100 >
1101 > clusterActive := "some random active cluster name"
1102 > clusterStandby := "some random standby cluster name"
1103 > configVersion := int64(10)
1104 > failoverVersion := int64(59)
1105 > isGlobalNamespace := true
1106 > clusters := []string{clusterActive, clusterStandby}
1107 >
1108 > resp1, err1 := m.CreateNamespace(
1109 > &persistencespb.NamespaceInfo{
1110 > Id: id,
1111 > Name: name,
1112 > State: state,
1113 > Description: description,
1114 > Owner: owner,
1115 > Data: data,
1116 > },
1117 > &persistencespb.NamespaceConfig{
1118 > Retention: retention,
1119 > HistoryArchivalState: historyArchivalState,
1120 > HistoryArchivalUri: historyArchivalURI,
1121 > VisibilityArchivalState: visibilityArchivalState,
1122 > VisibilityArchivalUri: visibilityArchivalURI,
1123 > },
1124 > &persistencespb.NamespaceReplicationConfig{
1125 > ActiveClusterName: clusterActive,
1126 > Clusters: clusters,
1127 > },
1128 > isGlobalNamespace,
1129 > configVersion,
1130 > failoverVersion,
1131 > )
1132 > m.NoError(err1)
1133 > m.EqualValues(id, resp1.ID)
1134 >
1135 > resp2, err2 := m.GetNamespace("", name)
1136 > m.NoError(err2)
1137 > m.NotNil(resp2)
1138 >
1139 > err3 := m.DeleteNamespace("", name)
1140 > m.NoError(err3)
1141 >
1142 > // May need to loop here to avoid potential inconsistent read-after-write in cassandra
1143 > m.Eventually(
1144 > func() bool {
1145 > resp, err := m.GetNamespace("", name)
1146 > if errors.As(err, new(*serviceerror.NamespaceNotFound)) {
1147 > m.Nil(resp)
1148 > return true
1149 > }
1150 return false
1151 },
1154 )
1155
1156 > resp5, err5 := m.GetNamespace(id, "") metadata_persistence_v2.go
1157 > m.Error(err5)
1158 > m.IsType(&serviceerror.NamespaceNotFound{}, err5)
1159 > m.Nil(resp5)
1160 >
1161 > id = uuid.NewString()
1162 > resp6, err6 := m.CreateNamespace(
1163 > &persistencespb.NamespaceInfo{
1164 > Id: id,
1165 > Name: name,
1166 > State: state,
1167 > Description: description,
1168 > Owner: owner,
1169 > Data: data,
1170 > },
1171 > &persistencespb.NamespaceConfig{
1172 > Retention: retention,
1173 > HistoryArchivalState: historyArchivalState,
1174 > HistoryArchivalUri: historyArchivalURI,
1175 > VisibilityArchivalState: visibilityArchivalState,
1176 > VisibilityArchivalUri: visibilityArchivalURI,
1177 > },
1178 > &persistencespb.NamespaceReplicationConfig{
1179 > ActiveClusterName: clusterActive,
1180 > Clusters: clusters,
1181 > },
1182 > isGlobalNamespace,
1183 > configVersion,
1184 > failoverVersion,
1185 > )
1186 > m.NoError(err6)
1187 > m.EqualValues(id, resp6.ID)
1188 >
1189 > err7 := m.DeleteNamespace(id, "")
1190 > m.NoError(err7)
1191 >
1192 > resp8, err8 := m.GetNamespace("", name)
1193 > m.Error(err8)
1194 > m.IsType(&serviceerror.NamespaceNotFound{}, err8)
1195 > m.Nil(resp8)
1196 >
1197 > resp9, err9 := m.GetNamespace(id, "")
1198 > m.Error(err9)
1199 > m.IsType(&serviceerror.NamespaceNotFound{}, err9)
1200 > m.Nil(resp9)
1201 }
1202