Skip to content

Commit

Permalink
Fix LGTM (sonic-net#28)
Browse files Browse the repository at this point in the history
* Add conf to host, move plugin to sbin

* Add missing comma in dependencies

* Correct flag to -p

* Fix events_info and j2

* Add host event

* Revert back to creating and moving

* Split into multiple regex for each process

* Modify regex and set .py to sbin in monit_events

* Change log level from err to notice

* Move publish tool to sbin

* Remove has_timer from init cfg

* Add peer review changes

* Change to /usr/bin

* Remove empty lines

* Change monit_events

* Remove mv

* Fix syntax issues

* Fix syntax

* Resolve LGTM
  • Loading branch information
zbud-msft authored Sep 16, 2022
1 parent 78ac446 commit e773a0e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/sonic-eventd/tools/events_monit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"index": "0"
}

# Async connection wait time in milliseconds.
ASYNC_CONN_WAIT = 300
# Async connection wait time in seconds.
ASYNC_CONN_WAIT = 0.3
RECEIVE_TIMEOUT = 1000

# Thread results
Expand Down Expand Up @@ -63,7 +63,7 @@ def test_receiver(event_obj, cnt):
sh = events_init_subscriber(False, RECEIVE_TIMEOUT, None)

# Sleep ASYNC_CONN_WAIT to ensure async connectivity is complete.
time.sleep(ASYNC_CONN_WAIT/1000)
time.sleep(ASYNC_CONN_WAIT)

exp_params = dict(test_event_params)

Expand Down Expand Up @@ -98,7 +98,7 @@ def test_receiver(event_obj, cnt):
k, v, rcv_params[k]))
rc = -1
else:
log_notice("key:{} is missing", k)
log_notice("key:{} is missing".format(k))
rc = -1

if (rc != 0):
Expand Down Expand Up @@ -136,7 +136,7 @@ def publish_events(cnt):

# Sleep ASYNC_CONN_WAIT to ensure async connectivity is complete.
# Messages published before connection are silently dropped by ZMQ.
time.sleep(ASYNC_CONN_WAIT/1000)
time.sleep(ASYNC_CONN_WAIT)

pub_params = dict(test_event_params)

Expand All @@ -154,7 +154,7 @@ def publish_events(cnt):
publish_cnt += 1

# Sleep ASYNC_CONN_WAIT to ensure publish complete, before closing channel.
time.sleep(ASYNC_CONN_WAIT/1000)
time.sleep(ASYNC_CONN_WAIT)

events_deinit_publisher(ph)

Expand All @@ -178,7 +178,7 @@ def run_test(cnt):
# Any event published prior to that could get lost
# Subscriber would wait for ASYNC_CONN_WAIT. Wait additional 200ms
# for signal from test_receiver as ready.
event_sub.wait((ASYNC_CONN_WAIT + 200)/1000)
event_sub.wait(ASYNC_CONN_WAIT + 0.2)
event_sub.clear()

rc_pub = publish_events(cnt)
Expand Down

0 comments on commit e773a0e

Please sign in to comment.