Skip to content

Commit 7e93fef

Browse files
committed
Test are more forgiving of extra node events
1 parent ba0ea4c commit 7e93fef

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

tests/server.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,13 @@ def _wait_events(
109109
if len(events) == 0:
110110
return
111111
elif strict:
112-
raise ValueError(json.dumps(diff, indent=4))
112+
# Container events are fully controlled by the test,
113+
# so any mismatch is a real failure. Node events may
114+
# include system noise (e.g. SELinux xattr changes)
115+
# that the test cannot predict, so they are skipped.
116+
is_container_event = bool(msg.process.container_id)
117+
if is_container_event:
118+
raise ValueError(json.dumps(diff, indent=4))
113119

114120
def wait_events(self, events: list[Event], strict: bool = True):
115121
"""

tests/test_xattr.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ def test_setxattr(
3838
xattr_name='user.fact_test',
3939
),
4040
],
41-
strict=False,
4241
)
4342

4443

@@ -69,7 +68,6 @@ def test_removexattr(
6968
xattr_name='user.fact_remove',
7069
),
7170
],
72-
strict=False,
7371
)
7472

7573

@@ -115,7 +113,6 @@ def test_setxattr_multiple(
115113
xattr_name='user.attr3',
116114
),
117115
],
118-
strict=False,
119116
)
120117

121118

@@ -156,7 +153,6 @@ def test_setxattr_ignored(
156153
xattr_name='user.monitored',
157154
),
158155
],
159-
strict=False,
160156
)
161157

162158

@@ -205,7 +201,6 @@ def test_setxattr_new_file(
205201
xattr_name='user.new_file',
206202
),
207203
],
208-
strict=False,
209204
)
210205

211206

@@ -268,5 +263,4 @@ def test_setxattr_utf8_filenames(
268263
xattr_name='user.utf8_test',
269264
),
270265
],
271-
strict=False,
272266
)

0 commit comments

Comments
 (0)