Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Nomad
Commits
dd8de794
Unverified
Commit
dd8de794
authored
3 years ago
by
Tim Gross
Committed by
GitHub
3 years ago
Browse files
Options
Download
Email Patches
Plain Diff
remove unbackportable test (#13312)
parent
ccb12010
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scheduler/generic_sched_test.go
+0
-87
scheduler/generic_sched_test.go
with
0 additions
and
87 deletions
+0
-87
scheduler/generic_sched_test.go
+
0
-
87
View file @
dd8de794
...
...
@@ -6397,93 +6397,6 @@ func TestServiceSched_CSIVolumesPerAlloc(t *testing.T) {
}
func
TestServiceSched_CSITopology
(
t
*
testing
.
T
)
{
ci
.
Parallel
(
t
)
h
:=
NewHarness
(
t
)
zones
:=
[]
string
{
"zone-0"
,
"zone-1"
,
"zone-2"
,
"zone-3"
}
// Create some nodes, each running a CSI plugin with topology for
// a different "zone"
for
i
:=
0
;
i
<
12
;
i
++
{
node
:=
mock
.
Node
()
node
.
Datacenter
=
zones
[
i
%
4
]
node
.
CSINodePlugins
=
map
[
string
]
*
structs
.
CSIInfo
{
"test-plugin-"
+
zones
[
i
%
4
]
:
{
PluginID
:
"test-plugin-"
+
zones
[
i
%
4
],
Healthy
:
true
,
NodeInfo
:
&
structs
.
CSINodeInfo
{
MaxVolumes
:
3
,
AccessibleTopology
:
&
structs
.
CSITopology
{
Segments
:
map
[
string
]
string
{
"zone"
:
zones
[
i
%
4
]}},
},
},
}
require
.
NoError
(
t
,
h
.
State
.
UpsertNode
(
structs
.
MsgTypeTestSetup
,
h
.
NextIndex
(),
node
))
}
// create 2 per-alloc volumes for those zones
vol0
:=
structs
.
NewCSIVolume
(
"myvolume[0]"
,
0
)
vol0
.
PluginID
=
"test-plugin-zone-0"
vol0
.
Namespace
=
structs
.
DefaultNamespace
vol0
.
AccessMode
=
structs
.
CSIVolumeAccessModeSingleNodeWriter
vol0
.
AttachmentMode
=
structs
.
CSIVolumeAttachmentModeFilesystem
vol0
.
RequestedTopologies
=
&
structs
.
CSITopologyRequest
{
Required
:
[]
*
structs
.
CSITopology
{{
Segments
:
map
[
string
]
string
{
"zone"
:
"zone-0"
},
}},
}
vol1
:=
vol0
.
Copy
()
vol1
.
ID
=
"myvolume[1]"
vol1
.
PluginID
=
"test-plugin-zone-1"
vol1
.
RequestedTopologies
.
Required
[
0
]
.
Segments
[
"zone"
]
=
"zone-1"
require
.
NoError
(
t
,
h
.
State
.
UpsertCSIVolume
(
h
.
NextIndex
(),
[]
*
structs
.
CSIVolume
{
vol0
,
vol1
}))
// Create a job that uses those volumes
job
:=
mock
.
Job
()
job
.
Datacenters
=
zones
job
.
TaskGroups
[
0
]
.
Count
=
2
job
.
TaskGroups
[
0
]
.
Volumes
=
map
[
string
]
*
structs
.
VolumeRequest
{
"myvolume"
:
{
Type
:
"csi"
,
Name
:
"unique"
,
Source
:
"myvolume"
,
PerAlloc
:
true
,
},
}
require
.
NoError
(
t
,
h
.
State
.
UpsertJob
(
structs
.
MsgTypeTestSetup
,
h
.
NextIndex
(),
job
))
// Create a mock evaluation to register the job
eval
:=
&
structs
.
Evaluation
{
Namespace
:
structs
.
DefaultNamespace
,
ID
:
uuid
.
Generate
(),
Priority
:
job
.
Priority
,
TriggeredBy
:
structs
.
EvalTriggerJobRegister
,
JobID
:
job
.
ID
,
Status
:
structs
.
EvalStatusPending
,
}
require
.
NoError
(
t
,
h
.
State
.
UpsertEvals
(
structs
.
MsgTypeTestSetup
,
h
.
NextIndex
(),
[]
*
structs
.
Evaluation
{
eval
}))
// Process the evaluation and expect a single plan without annotations
err
:=
h
.
Process
(
NewServiceScheduler
,
eval
)
require
.
NoError
(
t
,
err
)
require
.
Len
(
t
,
h
.
Plans
,
1
,
"expected one plan"
)
require
.
Nil
(
t
,
h
.
Plans
[
0
]
.
Annotations
,
"expected no annotations"
)
// Expect the eval has not spawned a blocked eval
require
.
Equal
(
t
,
len
(
h
.
CreateEvals
),
0
)
require
.
Equal
(
t
,
""
,
h
.
Evals
[
0
]
.
BlockedEval
,
"did not expect a blocked eval"
)
require
.
Equal
(
t
,
structs
.
EvalStatusComplete
,
h
.
Evals
[
0
]
.
Status
)
}
// TestPropagateTaskState asserts that propagateTaskState only copies state
// when the previous allocation is lost or draining.
func
TestPropagateTaskState
(
t
*
testing
.
T
)
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help