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

Add more tests to FDA check #7338

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

MarkusPettersson98
Copy link
Contributor

@MarkusPettersson98 MarkusPettersson98 commented Dec 13, 2024

This PR touches up the FDA check code just a little bit more to ensure that no obvious bugs are still present.


This change is Reviewable

@MarkusPettersson98 MarkusPettersson98 force-pushed the fda-bikeshedding branch 7 times, most recently from d9f663e to 900262b Compare December 13, 2024 14:04
@MarkusPettersson98 MarkusPettersson98 marked this pull request as ready for review December 13, 2024 14:05
@MarkusPettersson98 MarkusPettersson98 force-pushed the fda-bikeshedding branch 5 times, most recently from 304bdb3 to d8f82ad Compare December 13, 2024 14:28
Copy link
Member

@dlon dlon left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @MarkusPettersson98)


talpid-core/src/split_tunnel/macos/process.rs line 616 at r1 (raw file):

    #[tokio::test]
    async fn test_parse_logger_status_timeout() {
        let need_fda = parse_logger_status(

This test doesn't seem to test any time out now (since it immediately prints to stdout/stderr). It is identical to test_parse_logger_status_immediate_exit.

Would something like make more sense?

        let stdout = output("This will never be printed\n", Duration::MAX);
        let stderr = output(
            "ES_NEW_CLIENT_RESULT_ERR_NOT_PERMITTED\n",
            EARLY_FAIL_TIMEOUT + Duration::from_secs(1),
        );

Though I'm not sure if it's particularly valuable given that it's just a special case of test_parse_logger_status_hogged. Removing it might be fine?


talpid-core/src/split_tunnel/macos/process.rs line 657 at r1 (raw file):

            EARLY_FAIL_TIMEOUT / 2,
        );
        tokio::time::resume();

Are start and resume necessary here? I think it should just work if you only set the start_paused attribute: #[tokio::test(start_paused = true)]

Add test for checking that the newly added timeout to the
FDA check works as expected.
Copy link
Contributor Author

@MarkusPettersson98 MarkusPettersson98 left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @dlon)


talpid-core/src/split_tunnel/macos/process.rs line 616 at r1 (raw file):

Previously, dlon (David Lönnhager) wrote…

This test doesn't seem to test any time out now (since it immediately prints to stdout/stderr). It is identical to test_parse_logger_status_immediate_exit.

Would something like make more sense?

        let stdout = output("This will never be printed\n", Duration::MAX);
        let stderr = output(
            "ES_NEW_CLIENT_RESULT_ERR_NOT_PERMITTED\n",
            EARLY_FAIL_TIMEOUT + Duration::from_secs(1),
        );

Though I'm not sure if it's particularly valuable given that it's just a special case of test_parse_logger_status_hogged. Removing it might be fine?

It is a special case of test_parse_logger_status_hogged, so I think we can simply remove this one. Renaming it to test_parse_logger_status_timeout though 😊


talpid-core/src/split_tunnel/macos/process.rs line 657 at r1 (raw file):

Previously, dlon (David Lönnhager) wrote…

Are start and resume necessary here? I think it should just work if you only set the start_paused attribute: #[tokio::test(start_paused = true)]

We can get rid of start in favor of #[tokio::test(start_paused = true)], but resume seems relevant to me because time should not be frozen during the subsequent call to parse_logger_status. Maybe I understand the tokio::time test utils wrong tho

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