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

bzltestutil: restore timeout signal handler #3929

Merged
merged 2 commits into from
Apr 30, 2024

Conversation

sluongng
Copy link
Contributor

@sluongng sluongng commented Apr 29, 2024

In #3920, a new mechanism to
handle test timeout was introduced. However this broke existing tests
that use SIGTERM inside.

Restore the original behavior.


From the doc of signal.Ignore:

// Ignore causes the provided signals to be ignored. If they are received by
// the program, nothing will happen. Ignore undoes the effect of any prior
// calls to Notify for the provided signals.
// If no signals are provided, all incoming signals will be ignored.

so what it does is to iterate over signal.handlers.m, a package-level map variable that keeps track of all the signal -> channel that it needs to notify upon receiving a signal. Upon finding the right entries for the given signal, it will delete all the handlers for that signal.

This does not work for us because we have never called signal.Notify before signal.Ignore, thus the call to signal.Ignore deleted no handler and was effectively a no-ops. Using signal.Notify to first register a handler to capture the signal is the right fix.

Reference: https://cs.opensource.google/go/go/+/refs/tags/go1.22.2:src/os/signal/signal.go;l=86

@sluongng
Copy link
Contributor Author

@linzhp FYI

In bazelbuild#3920, a new mechanism to
handle test timeout was introduced. However this broke existing tests
that use SIGTERM inside.

Restore the original behavior.
@sluongng sluongng force-pushed the sluongng/restore-sig-notify branch from 1e8d3b1 to 2502b01 Compare April 30, 2024 08:29
go/tools/builders/generate_test_main.go Outdated Show resolved Hide resolved
@fmeum fmeum enabled auto-merge (squash) April 30, 2024 10:10
@fmeum fmeum merged commit 54c4515 into bazelbuild:master Apr 30, 2024
1 of 2 checks passed
renovate bot added a commit to kreempuff/rules_unreal_engine that referenced this pull request May 6, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [io_bazel_rules_go](https://github.com/bazelbuild/rules_go) |
http_archive | patch | `v0.47.0` -> `v0.47.1` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>bazelbuild/rules_go (io_bazel_rules_go)</summary>

###
[`v0.47.1`](https://github.com/bazelbuild/rules_go/releases/tag/v0.47.1)

[Compare
Source](https://github.com/bazelbuild/rules_go/compare/v0.47.0...v0.47.1)

#### `WORKSPACE` code

load("@&#8203;bazel_tools//tools/build_defs/repo:http.bzl",
"http_archive")

    http_archive(
        name = "io_bazel_rules_go",
sha256 =
"f74c98d6df55217a36859c74b460e774abc0410a47cc100d822be34d5f990f16",
        urls = [

"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.47.1/rules_go-v0.47.1.zip",

"https://github.com/bazelbuild/rules_go/releases/download/v0.47.1/rules_go-v0.47.1.zip",
        ],
    )

load("@&#8203;io_bazel_rules_go//go:deps.bzl", "go_register_toolchains",
"go_rules_dependencies")

    go_rules_dependencies()

    go_register_toolchains(version = "1.22.2")

#### What's Changed

- bzltestutil: restore timeout signal handler by
[@&#8203;sluongng](https://github.com/sluongng) in
[bazelbuild/rules_go#3929
- feat: support syso files in srcs. by
[@&#8203;connyay](https://github.com/connyay) in
[bazelbuild/rules_go#3763
- prepare patch release 0.47.1 by
[@&#8203;tyler-french](https://github.com/tyler-french) in
[bazelbuild/rules_go#3933

#### New Contributors

- [@&#8203;connyay](https://github.com/connyay) made their first
contribution in
[bazelbuild/rules_go#3763

**Full Changelog**:
bazelbuild/rules_go@v0.47.0...v0.47.1

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/kreempuff/rules_unreal_engine).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNDAuMTAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4zNDAuMTAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbXX0=-->
cgrindel-self-hosted-renovate bot added a commit to cgrindel/bazel-starlib that referenced this pull request May 6, 2024
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [io_bazel_rules_go](https://github.com/bazelbuild/rules_go) |
http_archive | patch | `v0.47.0` -> `v0.47.1` |

---

### Release Notes

<details>
<summary>bazelbuild/rules_go (io_bazel_rules_go)</summary>

###
[`v0.47.1`](https://github.com/bazelbuild/rules_go/releases/tag/v0.47.1)

[Compare
Source](https://github.com/bazelbuild/rules_go/compare/v0.47.0...v0.47.1)

#### `WORKSPACE` code

load("@&#8203;bazel_tools//tools/build_defs/repo:http.bzl",
"http_archive")

    http_archive(
        name = "io_bazel_rules_go",
sha256 =
"f74c98d6df55217a36859c74b460e774abc0410a47cc100d822be34d5f990f16",
        urls = [

"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.47.1/rules_go-v0.47.1.zip",

"https://github.com/bazelbuild/rules_go/releases/download/v0.47.1/rules_go-v0.47.1.zip",
        ],
    )

load("@&#8203;io_bazel_rules_go//go:deps.bzl", "go_register_toolchains",
"go_rules_dependencies")

    go_rules_dependencies()

    go_register_toolchains(version = "1.22.2")

#### What's Changed

- bzltestutil: restore timeout signal handler by
[@&#8203;sluongng](https://github.com/sluongng) in
[bazelbuild/rules_go#3929
- feat: support syso files in srcs. by
[@&#8203;connyay](https://github.com/connyay) in
[bazelbuild/rules_go#3763
- prepare patch release 0.47.1 by
[@&#8203;tyler-french](https://github.com/tyler-french) in
[bazelbuild/rules_go#3933

#### New Contributors

- [@&#8203;connyay](https://github.com/connyay) made their first
contribution in
[bazelbuild/rules_go#3763

**Full Changelog**:
bazelbuild/rules_go@v0.47.0...v0.47.1

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://github.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMDkuNCIsInVwZGF0ZWRJblZlciI6IjM2LjEwOS40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: Self-hosted Renovate Bot <361546+cgrindel-self-hosted-renovate[bot]@users.noreply.github.enterprise.com>
rrbutani pushed a commit to bazel-contrib/toolchains_llvm that referenced this pull request May 6, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [io_bazel_rules_go](https://github.com/bazelbuild/rules_go) |
http_archive | patch | `v0.47.0` -> `v0.47.1` |

---

### Release Notes

<details>
<summary>bazelbuild/rules_go (io_bazel_rules_go)</summary>

###
[`v0.47.1`](https://github.com/bazelbuild/rules_go/releases/tag/v0.47.1)

[Compare
Source](https://github.com/bazelbuild/rules_go/compare/v0.47.0...v0.47.1)

#### `WORKSPACE` code

load("@&#8203;bazel_tools//tools/build_defs/repo:http.bzl",
"http_archive")

    http_archive(
        name = "io_bazel_rules_go",
sha256 =
"f74c98d6df55217a36859c74b460e774abc0410a47cc100d822be34d5f990f16",
        urls = [

"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.47.1/rules_go-v0.47.1.zip",

"https://github.com/bazelbuild/rules_go/releases/download/v0.47.1/rules_go-v0.47.1.zip",
        ],
    )

load("@&#8203;io_bazel_rules_go//go:deps.bzl", "go_register_toolchains",
"go_rules_dependencies")

    go_rules_dependencies()

    go_register_toolchains(version = "1.22.2")

#### What's Changed

- bzltestutil: restore timeout signal handler by
[@&#8203;sluongng](https://github.com/sluongng) in
[bazelbuild/rules_go#3929
- feat: support syso files in srcs. by
[@&#8203;connyay](https://github.com/connyay) in
[bazelbuild/rules_go#3763
- prepare patch release 0.47.1 by
[@&#8203;tyler-french](https://github.com/tyler-french) in
[bazelbuild/rules_go#3933

#### New Contributors

- [@&#8203;connyay](https://github.com/connyay) made their first
contribution in
[bazelbuild/rules_go#3763

**Full Changelog**:
bazelbuild/rules_go@v0.47.0...v0.47.1

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/bazel-contrib/toolchains_llvm).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNDAuMTAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4zNDAuMTAiLCJ0YXJnZXRCcmFuY2giOiJtYXN0ZXIiLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
trunk-io bot pushed a commit to ride-app/payments-service that referenced this pull request May 6, 2024
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [io_bazel_rules_go](https://github.com/bazelbuild/rules_go) | http_archive | patch | `v0.47.0` -> `v0.47.1` |

---

### Release Notes

<details>
<summary>bazelbuild/rules_go (io_bazel_rules_go)</summary>

### [`v0.47.1`](https://github.com/bazelbuild/rules_go/releases/tag/v0.47.1)

[Compare Source](https://github.com/bazelbuild/rules_go/compare/v0.47.0...v0.47.1)

#### `WORKSPACE` code

    load("@&#8203;bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

    http_archive(
        name = "io_bazel_rules_go",
        sha256 = "f74c98d6df55217a36859c74b460e774abc0410a47cc100d822be34d5f990f16",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.47.1/rules_go-v0.47.1.zip",
            "https://github.com/bazelbuild/rules_go/releases/download/v0.47.1/rules_go-v0.47.1.zip",
        ],
    )

    load("@&#8203;io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")

    go_rules_dependencies()

    go_register_toolchains(version = "1.22.2")

#### What's Changed

-   bzltestutil: restore timeout signal handler by [@&#8203;sluongng](https://github.com/sluongng) in [bazelbuild/rules_go#3929
-   feat: support syso files in srcs. by [@&#8203;connyay](https://github.com/connyay) in [bazelbuild/rules_go#3763
-   prepare patch release 0.47.1 by [@&#8203;tyler-french](https://github.com/tyler-french) in [bazelbuild/rules_go#3933

#### New Contributors

-   [@&#8203;connyay](https://github.com/connyay) made their first contribution in [bazelbuild/rules_go#3763

**Full Changelog**: bazelbuild/rules_go@v0.47.0...v0.47.1

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/ride-app/payments-service).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNDAuMTAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4zNDAuMTAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbXX0=-->
cgrindel-self-hosted-renovate bot added a commit to cgrindel/rules_swift_package_manager that referenced this pull request Jun 26, 2024
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [io_bazel_rules_go](https://github.com/bazelbuild/rules_go) |
http_archive | minor | `v0.47.0` -> `v0.48.1` |

---

### Release Notes

<details>
<summary>bazelbuild/rules_go (io_bazel_rules_go)</summary>

###
[`v0.48.1`](https://github.com/bazelbuild/rules_go/releases/tag/v0.48.1)

[Compare
Source](https://github.com/bazelbuild/rules_go/compare/v0.48.0...v0.48.1)

#### `WORKSPACE` code

load("@&#8203;bazel_tools//tools/build_defs/repo:http.bzl",
"http_archive")

    http_archive(
        name = "io_bazel_rules_go",
sha256 =
"b2038e2de2cace18f032249cb4bb0048abf583a36369fa98f687af1b3f880b26",
        urls = [

"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.48.1/rules_go-v0.48.1.zip",

"https://github.com/bazelbuild/rules_go/releases/download/v0.48.1/rules_go-v0.48.1.zip",
        ],
    )

load("@&#8203;io_bazel_rules_go//go:deps.bzl", "go_register_toolchains",
"go_rules_dependencies")

    go_rules_dependencies()

    go_register_toolchains(version = "1.22.4")

**Full Changelog**:
bazelbuild/rules_go@v0.48.0...v0.48.1

###
[`v0.48.0`](https://github.com/bazelbuild/rules_go/releases/tag/v0.48.0)

[Compare
Source](https://github.com/bazelbuild/rules_go/compare/v0.47.1...v0.48.0)

#### Important Changes!

`--incompatible_enable_proto_toolchain_resolution` is now supported in
`rules_go`. This means that protoc should now be supplied as a
toolchain. `protoc` can be registered using
https://github.com/aspect-build/toolchains_protoc, or a local proto
toolchain can be added.

[`rules_proto`](https://github.com/bazelbuild/rules_proto) 6.0.0 is
required to use Go proto rules.

#### `WORKSPACE` code

load("@&#8203;bazel_tools//tools/build_defs/repo:http.bzl",
"http_archive")

    http_archive(
        name = "io_bazel_rules_go",
sha256 =
"33acc4ae0f70502db4b893c9fc1dd7a9bf998c23e7ff2c4517741d4049a976f8",
        urls = [

"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.48.0/rules_go-v0.48.0.zip",

"https://github.com/bazelbuild/rules_go/releases/download/v0.48.0/rules_go-v0.48.0.zip",
        ],
    )

load("@&#8203;io_bazel_rules_go//go:deps.bzl", "go_register_toolchains",
"go_rules_dependencies")

    go_rules_dependencies()

    go_register_toolchains(version = "1.22.3")

#### What's Changed

- Update docs to cover new FilePath ReplaceDirective Support by
[@&#8203;stefanpenner](https://github.com/stefanpenner) in
[bazelbuild/rules_go#3931
- go_test: use different mnemonic for compilation by
[@&#8203;sluongng](https://github.com/sluongng) in
[bazelbuild/rules_go#3936
- Add go.work support to the documentation by
[@&#8203;stefanpenner](https://github.com/stefanpenner) in
[bazelbuild/rules_go#3932
- feat(mode): add `purego` tag when `pure` by
[@&#8203;mattyclarkson](https://github.com/mattyclarkson) in
[bazelbuild/rules_go#3901
- generate_test_main: Move timeout handling back to bzltestutil by
[@&#8203;DolceTriade](https://github.com/DolceTriade) in
[bazelbuild/rules_go#3939
- Add support for `--incompatible_enable_proto_toolchain_resolution` by
[@&#8203;fmeum](https://github.com/fmeum) in
[bazelbuild/rules_go#3919
- Add exec_compatible_with to @&#8203;go_sdk//:builder by
[@&#8203;EdSchouten](https://github.com/EdSchouten) in
[bazelbuild/rules_go#3943
- prepare v0.48.0 release by
[@&#8203;tyler-french](https://github.com/tyler-french) in
[bazelbuild/rules_go#3946

#### New Contributors

- [@&#8203;stefanpenner](https://github.com/stefanpenner) made their
first contribution in
[bazelbuild/rules_go#3931

**Full Changelog**:
bazelbuild/rules_go@v0.47.1...v0.48.0

###
[`v0.47.1`](https://github.com/bazelbuild/rules_go/releases/tag/v0.47.1)

[Compare
Source](https://github.com/bazelbuild/rules_go/compare/v0.47.0...v0.47.1)

#### `WORKSPACE` code

load("@&#8203;bazel_tools//tools/build_defs/repo:http.bzl",
"http_archive")

    http_archive(
        name = "io_bazel_rules_go",
sha256 =
"f74c98d6df55217a36859c74b460e774abc0410a47cc100d822be34d5f990f16",
        urls = [

"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.47.1/rules_go-v0.47.1.zip",

"https://github.com/bazelbuild/rules_go/releases/download/v0.47.1/rules_go-v0.47.1.zip",
        ],
    )

load("@&#8203;io_bazel_rules_go//go:deps.bzl", "go_register_toolchains",
"go_rules_dependencies")

    go_rules_dependencies()

    go_register_toolchains(version = "1.22.2")

#### What's Changed

- bzltestutil: restore timeout signal handler by
[@&#8203;sluongng](https://github.com/sluongng) in
[bazelbuild/rules_go#3929
- feat: support syso files in srcs. by
[@&#8203;connyay](https://github.com/connyay) in
[bazelbuild/rules_go#3763
- prepare patch release 0.47.1 by
[@&#8203;tyler-french](https://github.com/tyler-french) in
[bazelbuild/rules_go#3933

#### New Contributors

- [@&#8203;connyay](https://github.com/connyay) made their first
contribution in
[bazelbuild/rules_go#3763

**Full Changelog**:
bazelbuild/rules_go@v0.47.0...v0.47.1

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://github.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMDkuNCIsInVwZGF0ZWRJblZlciI6IjM2LjEwOS40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: Self-hosted Renovate Bot <361546+cgrindel-self-hosted-renovate[bot]@users.noreply.github.enterprise.com>
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