Skip to content
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

fix(cloud-spanner): stop emulator container with background context #594

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

radhus
Copy link
Member

@radhus radhus commented Oct 4, 2024

Use a background context with a 10s timeout when stopping the emulator.

This makes sure the container is (at least attempted) stopped when e.g. pressing ctrl-c while running tests.

Use a background context with a 10s timeout when stopping the emulator.

This makes sure the container is (at least attempted) stopped when e.g.
pressing ctrl-c while running tests.
@radhus radhus requested a review from a team as a code owner October 4, 2024 07:02
@radhus radhus merged commit b1b5e7e into master Oct 4, 2024
3 checks passed
@radhus radhus deleted the spanner-close-always branch October 4, 2024 07:20
radhus added a commit that referenced this pull request Oct 31, 2024
Fixes a bug introduced in b1b5e7e
(PR #594) where an empty context is used, which removes the logger.

Could be done cleaner with Go >=1.21 as can be seen in a TODO comment.

Before:
```
❯ make go-test
[sage] building binary and generating Makefiles...
[go-test] running Go tests...
[go-test] starting Cloud Spanner emulator...
[go-test] running Cloud Spanner emulator on 0.0.0.0:44611
[sage] stopping down Cloud Spanner emulator...
```

After:
```
❯ make go-test
[sage] building binary and generating Makefiles...
[go-test] running Go tests...
[go-test] starting Cloud Spanner emulator...
[go-test] running Cloud Spanner emulator on 0.0.0.0:46023
[go-test] stopping down Cloud Spanner emulator...
```
radhus added a commit that referenced this pull request Oct 31, 2024
Fixes a bug introduced in b1b5e7e
(PR #594) where an empty context is used, which removes the logger.

Could be done cleaner with Go >=1.21 as can be seen in a TODO comment.

Before:
```
❯ make go-test
[sage] building binary and generating Makefiles...
[go-test] running Go tests...
[go-test] starting Cloud Spanner emulator...
[go-test] running Cloud Spanner emulator on 0.0.0.0:44611
[sage] stopping down Cloud Spanner emulator...
```

After:
```
❯ make go-test
[sage] building binary and generating Makefiles...
[go-test] running Go tests...
[go-test] starting Cloud Spanner emulator...
[go-test] running Cloud Spanner emulator on 0.0.0.0:46023
[go-test] stopping down Cloud Spanner emulator...
```
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.

2 participants