Skip to content

Commit 9b23cb1

Browse files
[integ-tests] Fix test_build_image intermittent failures
The failing point is where the code checks the output of `pcluster get_log_events`. It asserts the output same/different from the command with different input flags. The use of Regex is both unnecessary and wrong. It is unnecessary because there are no Regex in logs. It is wrong because it mistakes some symbols (e.g. `()`) as Regex operator, cause failures like: ``` AssertionError: Expected <Launched instance (instance id: i-0fc16a5f4611601a5)> to match pattern <Launched instance (instance id: i-0fc16a5f4611601a5)>, but did not. ``` This commit fixes bug from aws#3677 Signed-off-by: Hanwen <[email protected]>
1 parent f4b2508 commit 9b23cb1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/integration-tests/tests/createami/test_createami.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,10 +289,10 @@ def _test_get_image_log_events(image):
289289
assert_that(events).is_length(expect_count)
290290

291291
if expect_first is True:
292-
assert_that(events[0]["message"]).matches(first_event["message"])
292+
assert_that(events[0]["message"]).contains(first_event["message"])
293293

294294
if expect_first is False:
295-
assert_that(events[0]["message"]).does_not_match(first_event["message"])
295+
assert_that(events[0]["message"]).does_not_contain(first_event["message"])
296296

297297

298298
def _test_export_logs(s3_bucket_factory, image, region):

0 commit comments

Comments
 (0)