Permalink
Browse files

Fix unit test breakages

  • Loading branch information...
FooBarWidget committed Sep 17, 2013
1 parent dd92ec7 commit b7ed33d15e46cf0bdab4f7d8243275d6b7722374
@@ -720,7 +720,7 @@ class LoggerFactory: public enable_shared_from_this<LoggerFactory> {
LoggerPtr newTransaction(const string &groupName,
const string &category = "requests",
- const string &unionStationKey = string(),
+ const string &unionStationKey = "-",
const string &filters = string())
{
if (serverAddress.empty()) {
@@ -851,7 +851,7 @@ class LoggerFactory: public enable_shared_from_this<LoggerFactory> {
LoggerPtr continueTransaction(const string &txnId,
const string &groupName,
const string &category = "requests",
- const string &unionStationKey = string())
+ const string &unionStationKey = "-")
{
if (serverAddress.empty() || txnId.empty()) {
return createNullLogger();
@@ -870,7 +870,7 @@ class LoggingServer: public EventedMessageServer {
}
transaction = make_shared<Transaction>(this, ev_now(getLoop()));
- if (unionStationKey == "-") {
+ if (unionStationKey.empty() || unionStationKey == "-") {
char tempNodeId[MD5_HEX_SIZE];
if (nodeId == NULL) {
@@ -228,7 +228,7 @@ def close
end
end
- def new_transaction(group_name, category = :requests, union_station_key = nil)
+ def new_transaction(group_name, category = :requests, union_station_key = "-")
if !@server_address
return Log.new
elsif !group_name || group_name.empty?
@@ -287,7 +287,7 @@ def new_transaction(group_name, category = :requests, union_station_key = nil)
end
end
- def continue_transaction(txn_id, group_name, category = :requests, union_station_key = nil)
+ def continue_transaction(txn_id, group_name, category = :requests, union_station_key = "-")
if !@server_address
return Log.new
elsif !txn_id || txn_id.empty?
@@ -340,11 +340,11 @@ namespace tut {
client1.write("openTransaction",
TODAY_TXN_ID, "foobar", "", "requests", TODAY_TIMESTAMP_STR,
- "", "true", "true", NULL);
+ "-", "true", "true", NULL);
client1.read(args);
client2.write("openTransaction",
TODAY_TXN_ID, "foobar", "", "requests", TODAY_TIMESTAMP_STR,
- "", "true", NULL);
+ "-", "true", NULL);
client2.write("log", TODAY_TXN_ID, "1000", NULL);
client2.writeScalar("hello world");
client2.write("flush", NULL);
@@ -376,11 +376,11 @@ namespace tut {
client1.write("openTransaction",
TODAY_TXN_ID, "foobar", "", "requests", TODAY_TIMESTAMP_STR,
- "", "false", "true", NULL);
+ "-", "false", "true", NULL);
client1.read(args);
client2.write("openTransaction",
TODAY_TXN_ID, "foobar", "", "requests", TODAY_TIMESTAMP_STR,
- "", "false", NULL);
+ "-", "false", NULL);
client2.write("flush", NULL);
client2.read(args);
client2.disconnect();
@@ -403,11 +403,11 @@ namespace tut {
client1.write("openTransaction",
TODAY_TXN_ID, "foobar", "", "requests", TODAY_TIMESTAMP_STR,
- "", "true", "true", NULL);
+ "-", "true", "true", NULL);
client1.read(args);
client2.write("openTransaction",
TODAY_TXN_ID, "foobar", "", "requests", TODAY_TIMESTAMP_STR,
- "", "true", NULL);
+ "-", "true", NULL);
client2.write("flush", NULL);
client2.read(args);
@@ -428,11 +428,11 @@ namespace tut {
client1.write("openTransaction",
TODAY_TXN_ID, "foobar", "", "requests", TODAY_TIMESTAMP_STR,
- "", "false", "true", NULL);
+ "-", "false", "true", NULL);
client1.read(args);
client2.write("openTransaction",
TODAY_TXN_ID, "foobar", "", "requests", TODAY_TIMESTAMP_STR,
- "", "false", NULL);
+ "-", "false", NULL);
client2.write("flush", NULL);
client2.read(args);
@@ -704,7 +704,7 @@ namespace tut {
client1.write("openTransaction",
TODAY_TXN_ID, "foobar", "remote", "requests", TODAY_TIMESTAMP_STR,
- "", "true", NULL);
+ "-", "true", NULL);
client1.write("closeTransaction", TODAY_TXN_ID, TODAY_TIMESTAMP_STR, NULL);
client1.write("flush", NULL);
client1.read(args);
@@ -718,7 +718,7 @@ namespace tut {
// Test logging of new transaction.
SystemTime::forceAll(YESTERDAY);
- LoggerPtr log = factory->newTransaction("foobar", "requests", "",
+ LoggerPtr log = factory->newTransaction("foobar", "requests", "-",
"uri == \"/foo\""
"\1"
"uri != \"/bar\"");
@@ -727,7 +727,7 @@ namespace tut {
log->flushToDiskAfterClose(true);
log.reset();
- log = factory->newTransaction("foobar", "requests", "",
+ log = factory->newTransaction("foobar", "requests", "-",
"uri == \"/foo\""
"\1"
"uri == \"/bar\"");
@@ -28,7 +28,7 @@ module PhusionPassenger
end
def mock_time(time)
- AnalyticsLogger.stub!(:current_time).and_return(time)
+ AnalyticsLogger.stub(:current_time).and_return(time)
end
def start_agent

0 comments on commit b7ed33d

Please sign in to comment.