projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
13385: login-sync test works even if there is no fuse group
[arvados.git]
/
services
/
crunch-dispatch-slurm
/
crunch-dispatch-slurm_test.go
diff --git
a/services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go
b/services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go
index 6852fc4be81978dd557870a2b629d5e56e16fc47..499f6d5d7275cb609f48cf40c50de381210997ac 100644
(file)
--- a/
services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go
+++ b/
services/crunch-dispatch-slurm/crunch-dispatch-slurm_test.go
@@
-55,10
+55,11
@@
func (s *IntegrationSuite) TearDownTest(c *C) {
}
type slurmFake struct {
}
type slurmFake struct {
- didBatch [][]string
- didCancel []string
- didRenice [][]string
- queue string
+ didBatch [][]string
+ didCancel []string
+ didRelease []string
+ didRenice [][]string
+ queue string
// If non-nil, run this func during the 2nd+ call to Cancel()
onCancel func()
// Error returned by Batch()
// If non-nil, run this func during the 2nd+ call to Cancel()
onCancel func()
// Error returned by Batch()
@@
-74,6
+75,11
@@
func (sf *slurmFake) QueueCommand(args []string) *exec.Cmd {
return exec.Command("echo", sf.queue)
}
return exec.Command("echo", sf.queue)
}
+func (sf *slurmFake) Release(name string) error {
+ sf.didRelease = append(sf.didRelease, name)
+ return nil
+}
+
func (sf *slurmFake) Renice(name string, nice int64) error {
sf.didRenice = append(sf.didRenice, []string{name, fmt.Sprintf("%d", nice)})
return nil
func (sf *slurmFake) Renice(name string, nice int64) error {
sf.didRenice = append(sf.didRenice, []string{name, fmt.Sprintf("%d", nice)})
return nil
@@
-151,7
+157,7
@@
func (s *IntegrationSuite) integrationTest(c *C,
}
func (s *IntegrationSuite) TestNormal(c *C) {
}
func (s *IntegrationSuite) TestNormal(c *C) {
- s.slurm = slurmFake{queue: "zzzzz-dz642-queuedcontainer 10000 100\n"}
+ s.slurm = slurmFake{queue: "zzzzz-dz642-queuedcontainer 10000 100
PENDING Resources
\n"}
container := s.integrationTest(c,
nil,
func(dispatcher *dispatch.Dispatcher, container arvados.Container) {
container := s.integrationTest(c,
nil,
func(dispatcher *dispatch.Dispatcher, container arvados.Container) {
@@
-163,7
+169,7
@@
func (s *IntegrationSuite) TestNormal(c *C) {
}
func (s *IntegrationSuite) TestCancel(c *C) {
}
func (s *IntegrationSuite) TestCancel(c *C) {
- s.slurm = slurmFake{queue: "zzzzz-dz642-queuedcontainer 10000 100\n"}
+ s.slurm = slurmFake{queue: "zzzzz-dz642-queuedcontainer 10000 100
PENDING Resources
\n"}
readyToCancel := make(chan bool)
s.slurm.onCancel = func() { <-readyToCancel }
container := s.integrationTest(c,
readyToCancel := make(chan bool)
s.slurm.onCancel = func() { <-readyToCancel }
container := s.integrationTest(c,
@@
-217,6
+223,7
@@
func (s *IntegrationSuite) TestSbatchFail(c *C) {
{"object_uuid", "=", container.UUID},
{"event_type", "=", "dispatch"},
}}, &ll)
{"object_uuid", "=", container.UUID},
{"event_type", "=", "dispatch"},
}}, &ll)
+ c.Assert(err, IsNil)
c.Assert(len(ll.Items), Equals, 1)
}
c.Assert(len(ll.Items), Equals, 1)
}