Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gthea committed Sep 30, 2024
1 parent d40f32e commit 0c7497a
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void firstRequestChangeNumber() throws Exception {
splitRoomDatabase.clearAllTables();
splitRoomDatabase.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.DATBASE_MIGRATION_STATUS, GeneralInfoEntity.DATBASE_MIGRATION_STATUS_DONE));
splitRoomDatabase.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.CHANGE_NUMBER_INFO, INITIAL_CHANGE_NUMBER));
splitRoomDatabase.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.SPLITS_UPDATE_TIMESTAMP, System.currentTimeMillis() / 1000));
splitRoomDatabase.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.SPLITS_UPDATE_TIMESTAMP, System.currentTimeMillis()));

SplitClient client;

Expand All @@ -114,7 +114,7 @@ public void firstRequestChangeNumber() throws Exception {
.segmentsRefreshRate(30)
.impressionsRefreshRate(99999)
.streamingEnabled(false)
.logLevel(SplitLogLevel.DEBUG)
.logLevel(SplitLogLevel.VERBOSE)
.build();


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void setup() throws IOException {
SplitRoomDatabase splitRoomDatabase = DatabaseHelper.getTestDatabase(mContext);
splitRoomDatabase.clearAllTables();
splitRoomDatabase.generalInfoDao().update(
new GeneralInfoEntity(GeneralInfoEntity.SPLITS_UPDATE_TIMESTAMP, System.currentTimeMillis() / 1000 - 30));
new GeneralInfoEntity(GeneralInfoEntity.SPLITS_UPDATE_TIMESTAMP, System.currentTimeMillis() - 30));
SplitClientConfig config = new TestableSplitConfigBuilder().ready(30000)
.streamingEnabled(true)
.enableDebug()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public void testAll() throws Exception {
splitRoomDatabase.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.DATBASE_MIGRATION_STATUS, GeneralInfoEntity.DATBASE_MIGRATION_STATUS_DONE));
splitRoomDatabase.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.CHANGE_NUMBER_INFO, 2));
splitRoomDatabase.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.SPLITS_FILTER_QUERY_STRING, expectedQs));
splitRoomDatabase.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.SPLITS_UPDATE_TIMESTAMP, System.currentTimeMillis() / 1000));
splitRoomDatabase.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.SPLITS_UPDATE_TIMESTAMP, System.currentTimeMillis()));
SplitClient client;

final String url = mWebServer.url("/").url().toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public void onPostExecutionView(SplitClient client) {
}
}
try {
Thread.sleep(200);
Thread.sleep(500);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package tests.integration.streaming;

import static java.lang.Thread.sleep;
import static helper.IntegrationHelper.ResponseClosure.getSinceFromUri;

import android.content.Context;

import androidx.core.util.Pair;
Expand Down Expand Up @@ -41,9 +44,6 @@
import io.split.android.client.utils.logger.Logger;
import tests.integration.shared.TestingHelper;

import static java.lang.Thread.sleep;
import static helper.IntegrationHelper.ResponseClosure.getSinceFromUri;

public class SplitsKillProcessTest {
Context mContext;
BlockingQueue<String> mStreamingData;
Expand Down Expand Up @@ -83,7 +83,7 @@ public void setup() {
mSplitRoomDatabase.clearAllTables();
mUserKey = IntegrationHelper.dummyUserKey();
mSplitRoomDatabase.generalInfoDao().update(
new GeneralInfoEntity(GeneralInfoEntity.SPLITS_UPDATE_TIMESTAMP, System.currentTimeMillis() / 1000 - 30));
new GeneralInfoEntity(GeneralInfoEntity.SPLITS_UPDATE_TIMESTAMP, System.currentTimeMillis() - 30));
loadSplitChanges();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package tests.integration.streaming;

import static java.lang.Thread.sleep;
import static helper.IntegrationHelper.ResponseClosure.getSinceFromUri;

import android.content.Context;

import androidx.core.util.Pair;
Expand Down Expand Up @@ -40,9 +43,6 @@
import io.split.android.client.utils.logger.Logger;
import tests.integration.shared.TestingHelper;

import static java.lang.Thread.sleep;
import static helper.IntegrationHelper.ResponseClosure.getSinceFromUri;

public class SplitsSyncProcessTest {
Context mContext;
BlockingQueue<String> mStreamingData;
Expand Down Expand Up @@ -82,7 +82,7 @@ public void setup() {
mSplitRoomDatabase = Room.inMemoryDatabaseBuilder(mContext, SplitRoomDatabase.class).build();
mSplitRoomDatabase.clearAllTables();
mSplitRoomDatabase.generalInfoDao().update(
new GeneralInfoEntity(GeneralInfoEntity.SPLITS_UPDATE_TIMESTAMP, System.currentTimeMillis() / 1000 - 30));
new GeneralInfoEntity(GeneralInfoEntity.SPLITS_UPDATE_TIMESTAMP, System.currentTimeMillis() - 30));
mUserKey = IntegrationHelper.dummyUserKey();
loadSplitChanges();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ private void insertSplitsFromFileIntoDB() {

testDatabase.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.DATBASE_MIGRATION_STATUS, GeneralInfoEntity.DATBASE_MIGRATION_STATUS_DONE));
testDatabase.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.CHANGE_NUMBER_INFO, 1));
testDatabase.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.SPLITS_UPDATE_TIMESTAMP, System.currentTimeMillis() / 1000));
testDatabase.generalInfoDao().update(new GeneralInfoEntity(GeneralInfoEntity.SPLITS_UPDATE_TIMESTAMP, System.currentTimeMillis()));

testDatabase.splitDao().insert(entities);
}
Expand Down

0 comments on commit 0c7497a

Please sign in to comment.