Skip to content

Conversation

@jusiskin
Copy link
Contributor

What was the problem/requirement? (What/Why)

The mainline Linux canaries were failing the test_cap_kill_not_inherited_by_running_jobs E2E test with:

>       assert expected_pattern.search(full_session_log), failure_msg
E       AssertionError: Expected message not found in session log. Logs are in CloudWatch log group: /aws/deadline/farm-c455d32e6001446e91a2c894b2a3f2db/queue-a253007498b34ebba973d10572ff3219
E       assert None
E        +  where None = <built-in method search of re.Pattern object at 0x1b0b900>('Running Session Actions as user: job-user\n \n==============================================\n--------- Running Task\n==============================================\n----------------------------------------------\nPhase: Setup\n----------------------------------------------\n----------------------------------------------\nPhase: Running action\n----------------------------------------------\nRunning command sudo -u job-user -i setsid -w /sessions/session-90bb7a048d644f0c8e5864c0996c989a1rqfck2b/tmpjgcfvub9.sh\nCommand started as pid: 2433\nOutput:\n/sessions/session-90bb7a048d644f0c8e5864c0996c989a1rqfck2b/tmpjgcfvub9.sh: line 21: kill: (2303) - Operation not permitted\nProcess pid 2433 exited with code: 1 (unsigned) / 0x1 (hex)\n \n==============================================\n--------- Session Cleanup\n==============================================\nDeleting working directory: /sessions/session-90bb7a048d644f0c8e5864c0996c989a1rqfck2b\nRunning command sudo -u job-user -i setsid -w rm -rf /sessions/session-90bb7a048d644f0c8e5864c0996c989a1rqfck2b/embedded_files0fxvge6a /sessions/session-90bb7a048d644f0c8e5864c0996c989a1rqfck2b/tmp8lsbrmbb.json /sessions/session-90bb7a048d644f0c8e5864c0996c989a1rqfck2b/tmpjgcfvub9.sh\nCommand started as pid: 2464\nOutput:\nProcess pid 2464 exited with code: 0 (unsigned) / 0x0 (hex)')
E        +    where <built-in method search of re.Pattern object at 0x1b0b900> = re.compile('kill:\\ sending\\ signal\\ to\\ 2303\\ failed:\\ Operation\\ not\\ permitted').search
expected_pattern = re.compile('kill:\\ sending\\ signal\\ to\\ 2303\\ failed:\\ Operation\\ not\\ permitted')

The output formatting does not match the expected pattern. This is because the E2E test was developed and tested in #479 using an unreleased openjd-sessions version.

Specifically, there was a change to use exec here which cause the kill command being ran in the test's job template here from using the kill bash built-in command to instead use the kill GNU program (docs). This causes a change in the error output captured in standard output.

What was the solution? (How)

Broaden the expected output of the test to accept both the format produced by the bash built-in and the GNU program.

What is the impact of this change?

The tests will pass for existing openjd-sessions versions and for future openjd-sessions versions.

How was this change tested?

Ran the E2E test with both the 0.9.0 release of openjd-sessions and the mainline version of openjd-sessions using the OPENJD_SESSIONS_WHL_PATH env var (docs). Confirmed the E2E test passed in both test runs.

Was this change documented?

Added code comments to the E2E test explaining why the expected output pattern has two variants.

Is this a breaking change?

No


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@jusiskin jusiskin requested a review from a team as a code owner November 27, 2024 17:59
@sonarqubecloud
Copy link

@jusiskin jusiskin enabled auto-merge (squash) November 27, 2024 18:04
@jusiskin jusiskin merged commit 08ba3a4 into aws-deadline:mainline Nov 27, 2024
14 checks passed
@jusiskin jusiskin deleted the fix_cap_kill_test_for_openjd_sessions_0_9_0_and_earlier branch November 27, 2024 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants