aws-deadline / deadline-cloud-test-fixtures

This package contains pytest fixtures that are used to test AWS Deadline Cloud Python packages
Apache License 2.0
9 stars 13 forks source link

feat!: Add stop/start worker agent service method #130

Closed moorec-aws closed 2 months ago

moorec-aws commented 2 months ago

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

Added a start and stop method for the worker service.

Some flaky tests issues were uncovered:

  1. Attempting to get Worker ID before the worker has fully started and registered with service
  2. Checking for the service process before the service has completed starting.
  3. Initialization of the deadline-worker venv before configuring the worker was mistakenly removed in https://github.com/aws-deadline/deadline-cloud-test-fixtures/pull/125

Change the default job-users group. Require a way to create multiple windows job users

What was the solution? (How)

Added start and stop methods for windows and linux worker agent services

  1. increased timeout for 20 to 30 seconds
  2. Added a sleep to wait for worker to fully start and connect to service before attempting to get the worker id.
  3. Add the venv activate back
  4. Changed the default job-users group from deadline-job-users to job-users
  5. Added window_job_users list to support the creation of multiple windows users.

What is the impact of this change?

  1. Adds two new methods
  2. Fixes flaky test issues
  3. venv is now loaded before configuring the worker agent, so the proper python environment will be setup.

How was this change tested?

hatch run lint 
hatch run test

Ran the worker agent tests:

hatch run windows-e2e-tests
hatch run linux-e2e-test

Was this change documented?

No

Is this a breaking change?

Yes. The default job-user group has been changed from deadline-job-users to job-user


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