Skip to content

fix bugs in ping logic, ping hosts in parallel, and tweak README and LICENSE - #11

Merged
oxtoacart merged 1 commit into
mainfrom
percy/corp32862-2
Oct 1, 2025
Merged

fix bugs in ping logic, ping hosts in parallel, and tweak README and LICENSE#11
oxtoacart merged 1 commit into
mainfrom
percy/corp32862-2

Conversation

@oxtoacart

@oxtoacart oxtoacart commented Oct 1, 2025

Copy link
Copy Markdown
Collaborator

The ping logic had some bugs in the wait logic which are now fixed.

Pinging hosts in parallel will speed up CI.

LICENSE and README got small updates in preparation for moving this code
to tailscale/github-action.

Updates tailscale/corp#32862

@oxtoacart
oxtoacart force-pushed the percy/corp32862-2 branch 2 times, most recently from 8ccfe84 to 22d30cf Compare October 1, 2025 15:57
Comment thread src/main.ts Outdated
let start = new Date().getTime();
var first = true;
while ((new Date().getTime() - start) / 1000 < 180) {
if (!first) {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

My OG implementation of this was broken, I wasn't actually calling wait, and I wasn't using await :(

Comment thread dist/index.js
if (i < 0) {
let start = new Date().getTime();
var first = true;
while ((new Date().getTime() - start) / 1000 < 180) {

@oxtoacart oxtoacart Oct 1, 2025

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This allows us to more precisely enforce our promise of limiting this to 3 minutes. It's not perfect, but pretty good.

@oxtoacart
oxtoacart force-pushed the percy/corp32862-2 branch 6 times, most recently from 3e92905 to 46e00aa Compare October 1, 2025 16:26
@oxtoacart oxtoacart changed the title ping hosts in parallel and give ourselves 2 tries to establish direct… fix bugs in ping logic, ping hosts in parallel, and tweak README and LICENSE Oct 1, 2025
…LICENSE

The ping logic had some bugs in the wait logic which are now fixed.

Pinging hosts in parallel will speed up CI.

LICENSE and README got small updates in preparation for moving this code
to tailscale/github-action.

Updates tailscale/corp#32862

Signed-off-by: Percy Wegmann <percy@tailscale.com>
Comment thread dist/index.js
// Try for up to 180 seconds (3 minutes).
while ((new Date().getTime() - start) / 1000 < 180) {
if (i > 0) {
// Exponential backoff on wait time, with maximum 5 second wait.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

You can see this in action on this CI run.

@oxtoacart
oxtoacart merged commit 9bec0a4 into main Oct 1, 2025
13 checks passed
@jaxxstorm
jaxxstorm deleted the percy/corp32862-2 branch October 1, 2025 18:16
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