Permalink
Browse files

consistently passing tests

  • Loading branch information...
1 parent 1e90fce commit 8f21049b223cb77f2064af86a7c323c96a3efe54 Nick Kallen committed Apr 5, 2010
View
@@ -17,7 +17,7 @@ errors {
}
log {
- level = "info"
+ level = "error"
console = true
}
@@ -31,6 +31,19 @@ rowz {
shard_server_port = 7920
job_server_port = 7921
+ w3c = [
+ "action-timing",
+ "db-timing",
+ "connection-pool-release-timing",
+ "connection-pool-reserve-timing",
+ "kestrel-put-timing",
+ "db-select-count",
+ "db-execute-count",
+ "job-success-count",
+ "operation",
+ "arguments"
+ ]
+
aggregate_jobs_page_size = 500
db (inherit="db_default") {
@@ -21,17 +21,7 @@ object Main {
var shardServer: TSelectorServer = null
val config = Configgy.config
- val w3c = new W3CStats(Logger.get("w3c"), Array(
- "action-timing",
- "db-timing",
- "connection-pool-release-timing",
- "connection-pool-reserve-timing",
- "kestrel-put-timing",
- "db-select-count",
- "db-execute-count",
- "operation",
- "arguments"
- ))
+ val w3c = new W3CStats(Logger.get("w3c"), config.getList("rowz.w3c").toArray)
def main(args: Array[String]) {
state = Rowz(config, w3c)
@@ -11,17 +11,13 @@ import net.lag.logging.Logger
object Database {
val log = Logger.get
- val w3c = new W3CStats(log, Array(
- "action-timing",
- "db-timing",
- "connection-pool-release-timing"
- ))
val config = Configgy.config
+ val w3c = new W3CStats(log, config.getList("rowz.w3c").toArray)
val databaseFactory = new MemoizingDatabaseFactory(new ApachePoolingDatabaseFactory(
config("rowz.db.connection_pool.size_min").toInt,
config("rowz.db.connection_pool.size_max").toInt,
config("rowz.db.connection_pool.test_idle_msec").toLong.millis,
- config("rowz.db.connection_pool.max_wait").toLong.millis,gi
+ config("rowz.db.connection_pool.max_wait").toLong.millis,
config("rowz.db.connection_pool.test_on_borrow").toBoolean,
config("rowz.db.connection_pool.min_evictable_idle_msec").toLong.millis))
val queryEvaluatorFactory = new StandardQueryEvaluatorFactory(databaseFactory, new SqlQueryFactory)
@@ -19,23 +19,17 @@ object RowzSpec extends Specification with Eventually {
state.nameServer.rebuildSchema()
val shard1 = new ShardInfo("com.twitter.rowz.SqlShard", "shard_1", "localhost")
val shardId = state.nameServer.createShard(shard1)
- state.nameServer.setForwarding(new Forwarding(0, 0, shardId))
+ state.nameServer.setForwarding(new Forwarding(0, Math.MIN_LONG, shardId))
// state.nameServer.createShard(shard2)
state.start()
}
"row create & read" in {
- println("1")
val id = rowzService.create("row", Time.now.inSeconds)
- println("2")
rowzService.read(id) must eventually(not(throwA[Exception]))
- println("3")
val row = rowzService.read(id)
- println("4")
row.name mustEqual "row"
- println("5")
rowzService.destroy(row, 1.second.fromNow.inSeconds)
- println("6")
rowzService.read(id) must eventually(throwA[Exception])
}
}

0 comments on commit 8f21049

Please sign in to comment.