Skip to content

Conversation

@glbrntt
Copy link
Collaborator

@glbrntt glbrntt commented Dec 19, 2019

Motivation:

Sometimes, like when running under TSan, it's useful to disable long
running tests, or those which are sensitive to time.

Modifications:

Add an option to disable time sensitive tests via an envrionment
variable.

Result:

Certain tests are skipped if ENABLE_TIMING_TESTS is set to false.

Motivation:

Sometimes, like when running under TSan, it's useful to disable long
running tests, or those which are sensitive to time.

Modifications:

Add an option to disable time sensitive tests via an envrionment
variable.

Result:

Certain tests are skipped if `ENABLE_TIMING_TESTS` is set to false.
@glbrntt glbrntt requested a review from MrMage December 19, 2019 15:39
@glbrntt
Copy link
Collaborator Author

glbrntt commented Dec 19, 2019

Fixes #621

@glbrntt
Copy link
Collaborator Author

glbrntt commented Dec 19, 2019

Fixes #437

//
// https://docs.travis-ci.com/user/environment-variables/#default-environment-variables
private static var isLoggingEnabled = ProcessInfo.processInfo.environment["CI"] != "true"
private static let isLoggingEnabled = !Bool(
Copy link
Collaborator

Choose a reason for hiding this comment

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

!Bool looks a bit ugly — can we avoid that?

var runTimeSensitiveTests: Bool {
let shouldRun = GRPCTestCase.runTimeSensitiveTests
if !shouldRun {
print("Skipping '\(self.name)' as ENABLE_TIMING_TESTS=false")
Copy link
Collaborator

Choose a reason for hiding this comment

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

This side effect feels like a code small; at least convert this into a func? Also, what will self.name evaluate to?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure, let's make it a func. I'm okay with the side effect as it's only a print message in tests.

self.name looks like "-[FunctionalTestsMutualAuthentication testUnaryLotsOfRequests]"

@glbrntt glbrntt merged commit 7f10172 into grpc:nio Jan 6, 2020
@glbrntt glbrntt deleted the gb-time-sensitive-tests branch January 6, 2020 12:01
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