Skip to content

setup shutdown hooks on ServiceLifecycle::startAndWait #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 9, 2020

Conversation

tomerd
Copy link
Contributor

@tomerd tomerd commented Aug 8, 2020

motivation: fix startAndWait to work as advertised

changes:

  • extract shutdown setup to a func and call it from both start and startAndWait
  • add test
  • fix api doc

@tomerd tomerd requested review from ktoso, tanner0101 and yim-lee August 8, 2020 21:46
@tomerd tomerd force-pushed the fix/68 branch 5 times, most recently from 95d15fb to 87d01c5 Compare August 8, 2020 21:57
motivation: fix startAndWait to work as advertised

changes:
* extract shutdown setup to a func and call it from both start and startAndWait
* add test
* fix api doc
* fixi jazzy xenial issue (fixes ci)
@@ -18,7 +18,7 @@ RUN apt-get update && apt-get install -y lsof dnsutils netcat-openbsd net-tools

# ruby and jazzy for docs generation
RUN apt-get update && apt-get install -y ruby ruby-dev libsqlite3-dev
RUN gem install jazzy --no-ri --no-rdoc
RUN if [ "${ubuntu_version}" != "xenial" ] ; then gem install jazzy --no-ri --no-rdoc ; fi
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated jazzy issue on ubuntu 16.04, but required for CI to pass

@tomerd
Copy link
Contributor Author

tomerd commented Aug 8, 2020

closes #68

Copy link
Member

@tanner0101 tanner0101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@@ -91,6 +91,55 @@ final class ServiceLifecycleTests: XCTestCase {
XCTAssertEqual(item.state, .shutdown, "expected item to be shutdown")
}

func testStartAndWaitShutdownWithSignal() {
if ProcessInfo.processInfo.environment["SKIP_SIGNAL_TEST"].flatMap(Bool.init) ?? false {
print("skipping testStartAndWaitShutdownWithSignal")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tanner0101 tanner0101 added the kind/bug Feature doesn't work as expected. label Aug 8, 2020
@tomerd tomerd merged commit c8e9952 into swift-server:main Aug 9, 2020
@tomerd tomerd added this to the 1.0.0-alpha5 milestone Aug 9, 2020
Copy link
Collaborator

@yim-lee yim-lee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Late LGTM

Copy link
Contributor

@ktoso ktoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Late LGTM 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Feature doesn't work as expected.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants