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

Fixes unit tests so that they do not leak queries #1402

Merged
merged 2 commits into from
Dec 5, 2024

Conversation

matsduf
Copy link
Contributor

@matsduf matsduf commented Dec 4, 2024

Purpose

Unit tests in t/Test.t is leaking queries as reported in #1400. It turned out that network was not correctly set off. When that has been done there are two test cases, Nameserver08 and Nameserver09, that cannot be tested with recorded data.

This PR fixes the leaking unit test, but as a consequence Nameserver08 and Nameserver09 are excluded when testing with recorded data. This has also been documented in issue #1403.

The data file is also updated.

Context

#1400

How to test this PR

  • Tests must pass.
  • No queries should leak out.
  • Review the solution.

@matsduf matsduf added T-Bug Type: Bug in software or error in test case description V-Patch Versioning: The change gives an update of patch in version. labels Dec 4, 2024
@matsduf matsduf added this to the v2024.2 milestone Dec 4, 2024
t/Test.t Outdated Show resolved Hide resolved
t/Test.t Outdated Show resolved Hide resolved
t/Test.t Outdated Show resolved Hide resolved
Co-authored-by: tgreenx <96772376+tgreenx@users.noreply.github.com>
@mattias-p
Copy link
Member

An alternative approach would be to make the scrambling deterministic in Test.t by calling srand(12345) (or whatever your favorite number is).

@matsduf
Copy link
Contributor Author

matsduf commented Dec 4, 2024

An alternative approach would be to make the scrambling deterministic in Test.t by calling srand(12345) (or whatever your favorite number is).

The scrambling is done in the test case code using function/method scramble_case(). I guess you could change there, but that is out of the scope of this PR.

@matsduf matsduf merged commit b749b3e into zonemaster:develop Dec 5, 2024
3 checks passed
@matsduf matsduf deleted the fixes-leaking-unittest branch December 5, 2024 10:39
@tgreenx tgreenx linked an issue Dec 5, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Bug Type: Bug in software or error in test case description V-Patch Versioning: The change gives an update of patch in version.
Projects
None yet
3 participants