Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

ConfigValidationSpec overwrite the database password unexpectedly. #1

Open
wants to merge 1 commit into from

1 participant

Kazuhiro Suzuki
Kazuhiro Suzuki
ksauzz commented

Hi all,

I tried to build Rowz but the build often failed at random.
It seems ConfigValidationSpec overwrite the database password in the test. So I deleted it to fix. It works.

build command:
env DB_USERNAME=xxxx DB_PASSWORD=xxx sbt clean package-dist

Error message:
java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES) (FutureTask.java:232)

The running test is in random order. So I think if ConfigValidationSpec run at first in test, all following tests throw SQLException.
If ConfigValidationSpec run at last in the test, all tests are success.

Let me know if this writing is not helpful.
Sorry for my poor English. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

May 24, 2011
Kazuhiro Suzuki ksauzz remove overriding database password. 34fe4dc
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 0 additions and 14 deletions. Show diff stats Hide diff stats

  1. +0 14 src/test/scala/com/twitter/rowz/ConfigValidationSpec.scala
14 src/test/scala/com/twitter/rowz/ConfigValidationSpec.scala
@@ -7,20 +7,6 @@ import java.io.File
7 7 import config.{Rowz => RowzConfig}
8 8
9 9 object ConfigValidationSpec extends Specification {
10   - def setEnvVarForTest(key: String, value: String) {
11   - val env = System.getenv()
12   - val mapClass = classOf[java.util.Collections].getDeclaredClasses() filter {
13   - _.getName == "java.util.Collections$UnmodifiableMap"
14   - } head
15   -
16   - val field = mapClass.getDeclaredField("m")
17   - field.setAccessible(true)
18   -
19   - field.get(env).asInstanceOf[java.util.Map[String,String]].put(key, value)
20   - }
21   -
22   - setEnvVarForTest("DB_USERNAME", "root")
23   - setEnvVarForTest("DB_PASSWORD", "pass")
24 10
25 11 "Configuration Validation" should {
26 12 "test.scala" in {

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.