Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

Commit

Permalink
oops
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Maxwell committed Jan 16, 2011
1 parent 7b04deb commit 370df02
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
Expand Up @@ -85,7 +85,8 @@ abstract class IntegrationSpecification extends ConfiguredSpecification with Nam
}

nameServer.reload()
println("reloaded")
// MAGIC F'ing line
// println("reloaded")
}

def reset(config: flockdb.config.FlockDB, db: String) {
Expand Down
@@ -0,0 +1,55 @@
/*
* Copyright 2010 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.twitter.flockdb.integration

import org.specs.util.TimeConversions._

object DeadSimpleSpec extends IntegrationSpecification {
"Concurrency" should {
val FOLLOWS = 1

val alice = 1L
val bob = 2L
val carl = 3L
val darcy = 4L

doBefore {
reset(config)
}

"trivial changes" in {
val scheduler = jobScheduler(flockdb.Priority.High.id)
val errors = scheduler.errorQueue

try {
for (i <- 1 until 11) flock.execute(Select(alice, FOLLOWS, i).add.toThrift)
for (i <- 1 until 7) flock.execute(Select(bob, FOLLOWS, i * 2).add.toThrift)
flock.count(Select(alice, FOLLOWS, ()).toThrift) must eventually(20, 500.millis)(be_==(10))
flock.count(Select(bob, FOLLOWS, ()).toThrift) must eventually(20, 500.millis)(be_==(6))
} catch {
case e: Throwable => {
errors.size must eventually(be_>(0))
while(errors.size > 0) {
errors.get.foreach { ticket => println(ticket.job.toString) }
}
println(e.getMessage)
fail
}
}
}
}
}

0 comments on commit 370df02

Please sign in to comment.