Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed log rotation config #614

Merged
merged 4 commits into from
Apr 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plenum/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@


# Log configuration
logRotationWhen = 'W'
logRotationWhen = 'W6'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add test to check this value as it is done in node now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dsurnin done

logRotationInterval = 1
logRotationBackupCount = 50
logRotationMaxBytes = 100 * 1024 * 1024
Expand Down
4 changes: 3 additions & 1 deletion plenum/test/pool_transactions/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from indy.pool import refresh_pool_ledger
from plenum.test.node_catchup.helper import waitNodeDataEquality, \
ensureClientConnectedToNodesAndPoolLedgerSame
from plenum.test.node_request.helper import sdk_ensure_pool_functional
from stp_core.loop.looper import Looper
from stp_core.types import HA
from typing import Iterable, Union, Callable
Expand Down Expand Up @@ -504,7 +505,8 @@ def update_node_data_and_reconnect(looper, txnPoolNodeSet,
txnPoolNodeSet[idx] = restartedNode

looper.run(checkNodesConnected(txnPoolNodeSet))
sdk_pool_refresh(looper, sdk_pool_handle)
sdk_ensure_pool_functional(looper, txnPoolNodeSet,
steward_wallet, sdk_pool_handle)
return restartedNode


Expand Down
14 changes: 0 additions & 14 deletions plenum/test/pool_transactions/test_nodes_data_changed.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,6 @@
# reaches it


@pytest.fixture(scope="module")
def tconf(tconf):
old_retry_timeout_restricted = tconf.RETRY_TIMEOUT_RESTRICTED
old_retry_timeout_not_restricted = tconf.RETRY_TIMEOUT_NOT_RESTRICTED

tconf.RETRY_TIMEOUT_RESTRICTED = 0.3 * old_retry_timeout_restricted
tconf.RETRY_TIMEOUT_NOT_RESTRICTED = 0.3 * old_retry_timeout_not_restricted

yield tconf

tconf.RETRY_TIMEOUT_RESTRICTED = old_retry_timeout_restricted
tconf.RETRY_TIMEOUT_NOT_RESTRICTED = old_retry_timeout_not_restricted


def testNodePortCannotBeChangedByAnotherSteward(looper, txnPoolNodeSet,
sdk_wallet_steward,
sdk_pool_handle,
Expand Down
1 change: 1 addition & 0 deletions plenum/test/script/test_change_non_primary_node_ha.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@


@pytest.mark.skipif('sys.platform == "win32"', reason='SOV-330')
@pytest.mark.skip(reason='IS-626')
def testChangeNodeHaForNonPrimary(looper, txnPoolNodeSet, tdirWithClientPoolTxns,
poolTxnData, poolTxnStewardNames, tconf, tdir,
sdk_pool_handle, sdk_wallet_stewards):
Expand Down
9 changes: 9 additions & 0 deletions plenum/test/test_log_rotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,21 @@

from stp_core.common.logging.TimeAndSizeRotatingFileHandler \
import TimeAndSizeRotatingFileHandler
from stp_core.common.log import Logger


@pytest.fixture(params=[False, True], ids=["plain", "compressed"])
def log_compression(request):
return request.param

def test_default_log_rotation_config_is_correct(tdir_for_func):
logDirPath = tdir_for_func
logFile = os.path.join(logDirPath, "log")
logger = Logger()

# Assert this doesn't fail
logger.enableFileLogging(logFile)


def test_time_log_rotation(tdir_for_func, log_compression):
logDirPath = tdir_for_func
Expand Down
2 changes: 1 addition & 1 deletion stp_core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
baseDir = os.getcwd()

# Log configuration
logRotationWhen = 'W'
logRotationWhen = 'W6'
logRotationInterval = 1
logRotationBackupCount = 50
logRotationMaxBytes = 100 * 1024 * 1024
Expand Down