Skip to content

Convert PluginVC Regression Test to an Au Test. - #7203

Closed
ywkaras wants to merge 1 commit into
apache:masterfrom
ywkaras:PluginVC_UT
Closed

ywkaras wants to merge 1 commit into
apache:masterfrom
ywkaras:PluginVC_UT

Conversation

@ywkaras

@ywkaras ywkaras commented Sep 17, 2020 •

Copy link
Copy Markdown

I converted this to an Au test rather than a Catch test, because linking the Catch test executable was too difficult.

@ywkaras ywkaras self-assigned this Sep 17, 2020
@ywkaras ywkaras added this to the 10.0.0 milestone Sep 17, 2020
@ywkaras ywkaras added the AuTest label Sep 17, 2020
@ywkaras ywkaras linked an issue Sep 17, 2020 that may be closed by this pull request
@ywkaras

ywkaras commented Sep 22, 2020

Copy link
Copy Markdown
Author

Review hints:

  • The code in PluginVC_UT.cc is an edited version of the regression test code in proxy/PluginVC.cc
  • The code in NetVCTest.h and NetVCTest.cc is an edited version of the code in P_NetVCTest.h and NetVCTest.cc in iocore/net .

@ywkaras
ywkaras requested a review from bneradt September 22, 2020 20:29
Comment thread iocore/net/P_Net.h
#include "P_UnixPollDescriptor.h"
#include "P_Socks.h"
#include "P_CompletionUtil.h"
#include "P_NetVCTest.h"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Had to correct many improper dependencies on the fact that P_NetVCTest.h is included here and included Regression.h.

bneradt
bneradt previously approved these changes Sep 22, 2020

@bneradt bneradt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks great. I just have a few minor comments.

Comment on lines +52 to +60
tr = Test.AddTestRun()
tr.Processes.Default.StartBefore(ts)
tr.Processes.Default.Command = (
"N=60 ; while ((N > 0 )) ; do " +
"if [[ ! -f " + InProgressFilePathspec + " ]] ; then exit 0 ; fi ; sleep 1 ; let N=N-1 ; " +
"done ; echo 'TIMEOUT' ; exit 1"
)
tr.Processes.Default.ReturnCode = 0
tr.StillRunningAfter = ts

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we use the FileNotExists When function for this? I think it would look something like:

...
tr.Processes.Default.Command = "echo 'Wait for progress file to be deleted'"
tr.Processes.Default.Ready = When.FileNotExists(InProgressFilePathspec)
...

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

How do you control the maximum wait time?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I believe you should be able to use StartupTimeout.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

FileNotExists() seems to always return True. I am running autest 1.7.3, is this a bug in that version?


namespace Au_UT
{
extern char const Debug_tag[];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can this be a constexpr std::string_view defined in place here?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This could be misleading as TSDebug requires a null-terminated C-style string.

@randall randall left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, but waiting for @bneradt open comment

@ywkaras

ywkaras commented Sep 24, 2020

Copy link
Copy Markdown
Author

@SolidWallOfCode you may want to look at this as it involves a strategy of moving some unit testing from Catch to Au testing.

@bryancall
bryancall requested a review from zwoop January 28, 2021 22:42
@bryancall

Copy link
Copy Markdown
Contributor

@zwoop Can you please take a look at this?

@ywkaras ywkaras closed this May 24, 2021
@ywkaras ywkaras modified the milestones: 10.0.0, Sometime May 24, 2021
@zwoop zwoop removed this from the Sometime milestone Sep 23, 2021
@zwoop zwoop added Stale and removed Dormant labels Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression tests should be refactored as Au and Catch tests

5 participants