Skip to content

test: fix flaky test-dgram-empty-packet & friends #9724

New issue

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

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

Already on GitHub? # to your account

Closed
wants to merge 4 commits into from

Conversation

Trott
Copy link
Member

@Trott Trott commented Nov 21, 2016

Checklist
  • make -j8 test (UNIX), or vcbuild test nosign (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

test dgram

Description of change
  • Liberal use of common.mustCall()
  • Rename test-dgram-empty-packet -> test-dgram-send-empty-packet
  • Remove use of timers to avoid CI failures like seen in the Ref below:
not ok 237 parallel/test-dgram-empty-packet
  ---
  duration_ms: 0.717
  severity: fail
  stack: |-
    /usr/home/iojs/build/workspace/node-test-commit-freebsd/nodes/freebsd11-x64/test/parallel/test-dgram-empty-packet.js:38
        throw new Error('Timeout');
        ^

    Error: Timeout
        at Timeout._onTimeout
(/usr/home/iojs/build/workspace/node-test-commit-freebsd/nodes/freebsd11-x64/test/parallel/test-dgram-empty-packet.js:38:11)
        at ontimeout (timers.js:365:14)
        at tryOnTimeout (timers.js:237:5)
        at Timer.listOnTimeout (timers.js:207:5)

Refs: https://ci.nodejs.org/job/node-test-commit-freebsd/5341/nodes=freebsd11-x64/console:

@Trott Trott added dgram Issues and PRs related to the dgram subsystem / UDP. test Issues and PRs related to the tests. labels Nov 21, 2016
@Trott
Copy link
Member Author

Trott commented Nov 21, 2016

@Trott Trott force-pushed the de-timer-ize branch 2 times, most recently from f60c297 to 06c26b6 Compare November 21, 2016 19:25
@cjihrig
Copy link
Contributor

cjihrig commented Nov 21, 2016

Looks like the CI had a hiccup on OS X, which is pretty relevant to this test.

@Trott
Copy link
Member Author

Trott commented Nov 21, 2016

@cjihrig Yeah, looks like the bug on OS X is still there on the verison of OS X in CI. Putting the skip-code back in...

@Trott
Copy link
Member Author

Trott commented Nov 21, 2016

@Trott
Copy link
Member Author

Trott commented Nov 21, 2016

CI looks good. /cc @nodejs/testing @indutny

@santigimeno
Copy link
Member

The changes look good. I only see an issue with relying that every UDP message is going to be received by the server. This, though highly unlikely, could be a source of flakiness.

@Trott Trott force-pushed the de-timer-ize branch 3 times, most recently from b33bfca to c1c40fd Compare November 23, 2016 06:55
@Trott
Copy link
Member Author

Trott commented Nov 23, 2016

@santigimeno I've wrapped the client.send() call in setInterval() so that it will try again if the UDP message is not received.

CI: https://ci.nodejs.org/job/node-test-pull-request/4958/

Copy link
Member

@santigimeno santigimeno left a comment

Choose a reason for hiding this comment

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

LGTM with a couple of suggestions. Thanks!

const port = this.address().port;

client.on('message', common.mustCall(function onMessage(buffer, bytes) {
clearTimeout(timer);
clearInterval(interval);
client.close();
}));
Copy link
Member

Choose a reason for hiding this comment

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

maybe check that buffer is empty. Also s/bytes/info or even removing the 2nd argument if we're doing nothing with it

if (firstArg instanceof Buffer) {
clearInterval(interval);
client.close();
}
Copy link
Member

Choose a reason for hiding this comment

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

check firstArg is empty too?

* Liberal use of common.mustCall()
* Rename test-dgram-empty-packet -> test-dgram-send-empty-packet
* Remove use of timers to avoid CI failures like seen in the Ref below:

```
not ok 237 parallel/test-dgram-empty-packet
  ---
  duration_ms: 0.717
  severity: fail
  stack: |-
        ...
        throw new Error('Timeout');
        ^

    Error: Timeout
        at Timeout._onTimeout
        ...
        at ontimeout (timers.js:365:14)
        at tryOnTimeout (timers.js:237:5)
        at Timer.listOnTimeout (timers.js:207:5)
```

Refs: https://ci.nodejs.org/job/node-test-commit-freebsd/5341/nodes=freebsd11-x64/console:
@Trott
Copy link
Member Author

Trott commented Nov 24, 2016

Excellent suggestions from @santigimeno incorporated. CI again: https://ci.nodejs.org/job/node-test-pull-request/4978/

@Trott
Copy link
Member Author

Trott commented Nov 24, 2016

Raspberry Pi failure in CI is a build failure and unrelated.

Trott added a commit to Trott/io.js that referenced this pull request Nov 24, 2016
* Liberal use of common.mustCall()
* Rename test-dgram-empty-packet -> test-dgram-send-empty-packet
* Remove use of timers to avoid CI failures like seen in the Ref below:

```
not ok 237 parallel/test-dgram-empty-packet
  ---
  duration_ms: 0.717
  severity: fail
  stack: |-
        ...
        throw new Error('Timeout');
        ^

    Error: Timeout
        at Timeout._onTimeout
        ...
        at ontimeout (timers.js:365:14)
        at tryOnTimeout (timers.js:237:5)
        at Timer.listOnTimeout (timers.js:207:5)
```

Refs: https://ci.nodejs.org/job/node-test-commit-freebsd/5341/nodes=freebsd11-x64/console:
PR-URL: nodejs#9724
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
@Trott
Copy link
Member Author

Trott commented Nov 24, 2016

Landed in 9b0f53d

@Trott Trott closed this Nov 24, 2016
addaleax pushed a commit that referenced this pull request Dec 5, 2016
* Liberal use of common.mustCall()
* Rename test-dgram-empty-packet -> test-dgram-send-empty-packet
* Remove use of timers to avoid CI failures like seen in the Ref below:

```
not ok 237 parallel/test-dgram-empty-packet
  ---
  duration_ms: 0.717
  severity: fail
  stack: |-
        ...
        throw new Error('Timeout');
        ^

    Error: Timeout
        at Timeout._onTimeout
        ...
        at ontimeout (timers.js:365:14)
        at tryOnTimeout (timers.js:237:5)
        at Timer.listOnTimeout (timers.js:207:5)
```

Refs: https://ci.nodejs.org/job/node-test-commit-freebsd/5341/nodes=freebsd11-x64/console:
PR-URL: #9724
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
@Fishrock123 Fishrock123 mentioned this pull request Dec 5, 2016
2 tasks
addaleax pushed a commit to addaleax/node that referenced this pull request Dec 8, 2016
* Liberal use of common.mustCall()
* Rename test-dgram-empty-packet -> test-dgram-send-empty-packet
* Remove use of timers to avoid CI failures like seen in the Ref below:

```
not ok 237 parallel/test-dgram-empty-packet
  ---
  duration_ms: 0.717
  severity: fail
  stack: |-
        ...
        throw new Error('Timeout');
        ^

    Error: Timeout
        at Timeout._onTimeout
        ...
        at ontimeout (timers.js:365:14)
        at tryOnTimeout (timers.js:237:5)
        at Timer.listOnTimeout (timers.js:207:5)
```

Refs: https://ci.nodejs.org/job/node-test-commit-freebsd/5341/nodes=freebsd11-x64/console:
PR-URL: nodejs#9724
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
MylesBorins pushed a commit that referenced this pull request Dec 21, 2016
* Liberal use of common.mustCall()
* Rename test-dgram-empty-packet -> test-dgram-send-empty-packet
* Remove use of timers to avoid CI failures like seen in the Ref below:

```
not ok 237 parallel/test-dgram-empty-packet
  ---
  duration_ms: 0.717
  severity: fail
  stack: |-
        ...
        throw new Error('Timeout');
        ^

    Error: Timeout
        at Timeout._onTimeout
        ...
        at ontimeout (timers.js:365:14)
        at tryOnTimeout (timers.js:237:5)
        at Timer.listOnTimeout (timers.js:207:5)
```

Refs: https://ci.nodejs.org/job/node-test-commit-freebsd/5341/nodes=freebsd11-x64/console:
PR-URL: #9724
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Dec 21, 2016
@Trott Trott deleted the de-timer-ize branch January 13, 2022 22:44
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
dgram Issues and PRs related to the dgram subsystem / UDP. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants