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

dotsv2: remove jitters entirely #368

Merged
merged 1 commit into from
Sep 16, 2023

Conversation

howardjohn
Copy link
Contributor

As best I can tell, this fully fixes #352

While there were a variety of workarounds I tried to fix this, which had some improvement, the real root cause is doing clear screen; write. This leaves some time where each cell in the terminal goes from <something> -> empty -> <something>, which leads to blinking.

Instead, we can write and clear as we go. This has the same end result, but avoids the intermediate step where we have an empty cell.

This PR is probably not acceptable as-is as it doesn't even compile on windows. Not sure the best steps there, I neither have experience with implementing this in windows nor a machine to test on. We could keep the old implementation for windows, possibly.

@dnephin
Copy link
Member

dnephin commented Sep 13, 2023

Nice! This works great for me. I also don't have a windows machine. I think leaving the old implementation for windows would be fine.

@howardjohn
Copy link
Contributor Author

Nice! This works great for me. I also don't have a windows machine. I think leaving the old implementation for windows would be fine.

SGTM, I left it as-is for now and commented that it could be improved in the future if someone wants

Copy link
Member

@dnephin dnephin left a comment

Choose a reason for hiding this comment

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

Thank you making these improvements!

Comment on lines +6 to +7
[?25h[?25l

Copy link
Member

Choose a reason for hiding this comment

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

I think it's pretty cool that you can see the functional change to the logic by looking at the golden file. The control sequences moved to a different place in the output.

@dnephin dnephin merged commit ec99a25 into gotestyourself:main Sep 16, 2023
8 checks passed
oguzhand95 pushed a commit to cerbos/cerbos-sdk-go that referenced this pull request Sep 28, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[github.com/cerbos/cerbos/api/genpb](https://github.com/cerbos/cerbos)
| require | digest | `0d63f1e` -> `341baa4` |
|
[github.com/grpc-ecosystem/go-grpc-middleware/v2](https://github.com/grpc-ecosystem/go-grpc-middleware)
| require | patch | `v2.0.0` -> `v2.0.1` |
| [github.com/lestrrat-go/jwx/v2](https://github.com/lestrrat-go/jwx)
| require | patch | `v2.0.12` -> `v2.0.13` |
| [google.golang.org/grpc](https://github.com/grpc/grpc-go) | require
| patch | `v1.58.0` -> `v1.58.2` |
|
[gotest.tools/gotestsum](https://github.com/gotestyourself/gotestsum)
| require | minor | `v1.10.1` -> `v1.11.0` |

---

### Release Notes

<details>
<summary>grpc-ecosystem/go-grpc-middleware
(github.com/grpc-ecosystem/go-grpc-middleware/v2)</summary>

###
[`v2.0.1`](https://github.com/grpc-ecosystem/go-grpc-middleware/releases/tag/v2.0.1)

[Compare
Source](https://github.com/grpc-ecosystem/go-grpc-middleware/compare/v2.0.0...v2.0.1)

#### What's Changed

- Fix outdated 'make proto' command by
[@&#8203;takp](https://github.com/takp) in
[grpc-ecosystem/go-grpc-middleware#623
- Fix linting errors by [@&#8203;takp](https://github.com/takp) in
[grpc-ecosystem/go-grpc-middleware#624
- Logging: Add missing variadic operator for fields by
[@&#8203;olivierlemasle](https://github.com/olivierlemasle) in
[grpc-ecosystem/go-grpc-middleware#629
- feat: Support extracting fields from CallMeta by
[@&#8203;fsaintjacques](https://github.com/fsaintjacques) in
[grpc-ecosystem/go-grpc-middleware#628
- Fix "make test" and "make lint" by
[@&#8203;olivierlemasle](https://github.com/olivierlemasle) in
[grpc-ecosystem/go-grpc-middleware#627
- Do not set timeout for stream initialization by
[@&#8203;DavyJohnes](https://github.com/DavyJohnes) in
[grpc-ecosystem/go-grpc-middleware#645
- Add logging option to disable fields in log entry by
[@&#8203;coleenquadros](https://github.com/coleenquadros) in
[grpc-ecosystem/go-grpc-middleware#631
- Update logging adapter docs by
[@&#8203;aboryslawski](https://github.com/aboryslawski) in
[grpc-ecosystem/go-grpc-middleware#647

#### New Contributors

- [@&#8203;takp](https://github.com/takp) made their first
contribution in
[grpc-ecosystem/go-grpc-middleware#623
- [@&#8203;olivierlemasle](https://github.com/olivierlemasle) made
their first contribution in
[grpc-ecosystem/go-grpc-middleware#629
- [@&#8203;fsaintjacques](https://github.com/fsaintjacques) made their
first contribution in
[grpc-ecosystem/go-grpc-middleware#628
- [@&#8203;DavyJohnes](https://github.com/DavyJohnes) made their first
contribution in
[grpc-ecosystem/go-grpc-middleware#645
- [@&#8203;coleenquadros](https://github.com/coleenquadros) made their
first contribution in
[grpc-ecosystem/go-grpc-middleware#631
- [@&#8203;aboryslawski](https://github.com/aboryslawski) made their
first contribution in
[grpc-ecosystem/go-grpc-middleware#647

**Full Changelog**:
grpc-ecosystem/go-grpc-middleware@v2.0.0...v2.0.1

</details>

<details>
<summary>lestrrat-go/jwx (github.com/lestrrat-go/jwx/v2)</summary>

###
[`v2.0.13`](https://github.com/lestrrat-go/jwx/releases/tag/v2.0.13)

[Compare
Source](https://github.com/lestrrat-go/jwx/compare/v2.0.12...v2.0.13)

    v2.0.13 26 Sep 2023
    [New Features]
* [jwk] jwk.Equal has been added. Please note that this is equivalent to
comparing the keys' thumbprints, therefore it does NOT take in
consideration
      non-essential fields.

    [Miscellaneous]
      * Various documentation fixes and additions.

</details>

<details>
<summary>grpc/grpc-go (google.golang.org/grpc)</summary>

### [`v1.58.2`](https://github.com/grpc/grpc-go/releases/tag/v1.58.2):
Release 1.58.2

[Compare
Source](https://github.com/grpc/grpc-go/compare/v1.58.1...v1.58.2)

### Bug Fixes

-   balancer/weighted_round_robin: fix ticker leak on update

A new ticker is created every time there is an update of addresses or
configuration, but was not properly stopped. This change stops the
ticker when it is no longer needed.

### [`v1.58.1`](https://github.com/grpc/grpc-go/releases/tag/v1.58.1):
Release 1.58.1

[Compare
Source](https://github.com/grpc/grpc-go/compare/v1.58.0...v1.58.1)

##### Bug Fixes

- grpc: fix a bug that was decrementing active RPC count too early for
streaming RPCs; leading to channel moving to IDLE even though it had
open streams
- grpc: fix a bug where transports were not being closed upon channel
entering IDLE

</details>

<details>
<summary>gotestyourself/gotestsum (gotest.tools/gotestsum)</summary>

###
[`v1.11.0`](https://github.com/gotestyourself/gotestsum/releases/tag/v1.11.0)

[Compare
Source](https://github.com/gotestyourself/gotestsum/compare/v1.10.1...v1.11.0)

#### What's Changed

- handle multiple levels in subtest regex generation by
[@&#8203;brycekahle](https://github.com/brycekahle) in
[gotestyourself/gotestsum#342
- rerun-fails: prevent extra runs when a sub-test fails by
[@&#8203;brycekahle](https://github.com/brycekahle) in
[gotestyourself/gotestsum#343
- Add note about binary test result caching by
[@&#8203;nfi-hashicorp](https://github.com/nfi-hashicorp) in
[gotestyourself/gotestsum#350
- dots-v2: hide cursor during output by
[@&#8203;howardjohn](https://github.com/howardjohn) in
[gotestyourself/gotestsum#354
- Export elapsed time to the post-run environment by
[@&#8203;afbjorklund](https://github.com/afbjorklund) in
[gotestyourself/gotestsum#360
- Include test.timeout stack trace in the junit.xml by
[@&#8203;dnephin](https://github.com/dnephin) in
[gotestyourself/gotestsum#357
- Fix dots formats with stderr by
[@&#8203;dnephin](https://github.com/dnephin) in
[gotestyourself/gotestsum#358
- Rename TESTS_ELAPSED environment variable by
[@&#8203;afbjorklund](https://github.com/afbjorklund) in
[gotestyourself/gotestsum#361
- GitHub actions format by
[@&#8203;dnephin](https://github.com/dnephin) in
[gotestyourself/gotestsum#315
- Add the time unit to elapsed time duration by
[@&#8203;afbjorklund](https://github.com/afbjorklund) in
[gotestyourself/gotestsum#363
- Add testdox format by
[@&#8203;bitfield](https://github.com/bitfield) in
[gotestyourself/gotestsum#359
- Add post-run-command notify implementation for linux by
[@&#8203;afbjorklund](https://github.com/afbjorklund) in
[gotestyourself/gotestsum#362
- dotsv2: remove jitters entirely by
[@&#8203;howardjohn](https://github.com/howardjohn) in
[gotestyourself/gotestsum#368

#### New Contributors

- [@&#8203;brycekahle](https://github.com/brycekahle) made their first
contribution in
[gotestyourself/gotestsum#342
- [@&#8203;nfi-hashicorp](https://github.com/nfi-hashicorp) made their
first contribution in
[gotestyourself/gotestsum#350
- [@&#8203;howardjohn](https://github.com/howardjohn) made their first
contribution in
[gotestyourself/gotestsum#354
- [@&#8203;afbjorklund](https://github.com/afbjorklund) made their
first contribution in
[gotestyourself/gotestsum#360
- [@&#8203;bitfield](https://github.com/bitfield) made their first
contribution in
[gotestyourself/gotestsum#359

**Full Changelog**:
gotestyourself/gotestsum@v1.10.1...v1.11.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 4am on Monday" (UTC),
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.

👻 **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 [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/cerbos/cerbos-sdk-go).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMDcuMiIsInVwZGF0ZWRJblZlciI6IjM2LjEwNy4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Oğuzhan Durgun <oguzhandurgun95@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
howardjohn added a commit to howardjohn/gotestsum that referenced this pull request Mar 5, 2024
This had some previous fixes:
* gotestyourself#368
* gotestyourself#354

These do not fully fix the problem, only mask the issues.

The real issues arise when there are 100s of packages to display, but
only so much screen space. As each one bounces around, the text is
entirely unreadable. The previous approaches was to more effieciently
update the lines to make it more incremental.

The approach here is different - simple but extremely effective. Instead
of trying to constantly write out the entire set of lines/packages under
test, on each event, we keep track of a active and completed set of
packages.

Once a package is completed, we write it out one last time, and then
never overwrite it. The active set is treated as we do today.

This means if we have 8 core machine and 1000 packages, we are only
updating 8 lines at a time, which removes all jitteriness.
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.

dots-v2 is jittery
2 participants