Belle II Software development
TestModule Class Reference
Inheritance diagram for TestModule:

Public Member Functions

def __init__ (self, init_signal, event_signal)
 
def initialize (self)
 
def event (self)
 

Public Attributes

 init_signal
 signal to emit to ourselves during initialize()
 
 event_signal
 signal to emit to ourselves during event()
 

Detailed Description

test

Definition at line 27 of file signals.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  init_signal,
  event_signal 
)
Setup module for given signal settings

Definition at line 30 of file signals.py.

30 def __init__(self, init_signal, event_signal):
31 """Setup module for given signal settings"""
32 super().__init__()
33
34 self.init_signal = init_signal
35
36 self.event_signal = event_signal
37

Member Function Documentation

◆ event()

def event (   self)
If init_signal is true raise error, if event_signal is true kill process, otherwise print info

Definition at line 47 of file signals.py.

47 def event(self):
48 """If init_signal is true raise error, if event_signal is true kill process, otherwise print info"""
49 if self.init_signal:
50 basf2.B2FATAL("Processing should have been stopped in init!")
51 if self.event_signal:
52 pid = os.getpid()
53 basf2.B2INFO(f"Killing {pid} in event (sig {int(self.event_signal)})")
54 os.kill(pid, self.event_signal)
55 basf2.B2INFO("event()")
56
57
58# Tests running in Bamboo have SIGQUIT blocked via sigmask(3),
59# so let's unblock it for this test.
60# See Jira ticket BII-1948 for details

◆ initialize()

def initialize (   self)
If init_signal is true, kill on init, otherwise just print info

Definition at line 38 of file signals.py.

38 def initialize(self):
39 """If init_signal is true, kill on init, otherwise just print info"""
40
41 if self.init_signal:
42 pid = os.getpid()
43 basf2.B2INFO(f"Killing {pid} in init (sig {int(self.init_signal)})")
44 os.kill(pid, self.init_signal)
45 basf2.B2INFO("initialize()")
46

Member Data Documentation

◆ event_signal

event_signal

signal to emit to ourselves during event()

Definition at line 36 of file signals.py.

◆ init_signal

init_signal

signal to emit to ourselves during initialize()

Definition at line 34 of file signals.py.


The documentation for this class was generated from the following file: