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

test: make guard dog death tests run first always #717

Merged
merged 1 commit into from
Apr 7, 2017
Merged

Conversation

mattklein123
Copy link
Member

There appears to be a race condition during thread cleanup and fork
where pthread_join can return but the thread is still being fully
destroyed. This can lead to issues during fork.

There appears to be a race condition during thread cleanup and fork
where pthread_join can return but the thread is still being fully
destroyed. This can lead to issues during fork.
@mattklein123
Copy link
Member Author

@dnoe

@dnoe
Copy link
Contributor

dnoe commented Apr 7, 2017

This looks good to me (although I haven't repro'd this specific problem so I can't verify that). I now realize that I had originally confused the definitions of "Test" and "Test Case". It is the test case (group of tests, not individual test name ending in DeathTest) that is run first so you do need to create the trivial derived fixture class with alternate name like you did.

Copy link
Contributor

@dnoe dnoe left a comment

Choose a reason for hiding this comment

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

LGTM

@mattklein123 mattklein123 merged commit 2777b3f into master Apr 7, 2017
@mattklein123 mattklein123 deleted the gd_test branch April 7, 2017 17:59
rshriram pushed a commit to rshriram/envoy that referenced this pull request Oct 30, 2018
Automatic merge from submit-queue.

[DO NOT MERGE] Auto PR to update dependencies of proxy

This PR will be merged automatically once checks are successful.
```release-note
none
```
jpsim pushed a commit that referenced this pull request Nov 28, 2022
## Description

This change adds the ability to automatically flush stats based on application lifecycle changes (in addition to the scheduled flushing interval).

Enabling this flushing system is done **automatically** when the iOS/Android clients are instantiated.

On **iOS**, this is done by observing `NSNotificationCenter`.

**Android** requires an `Application` context to use for registering lifecycle callbacks. To accommodate this, the `Application` is now passed in to the Android builder instead of the `Context`.

Right now this new stats flushing behavior is enabled by default. In the future, we would like to investigate making it optional using the builder pattern. For example:

```swift
EnvoyClientBuilder()
  .addAppLifecycleHandling()
  .build()
```

```kotlin
AndroidEnvoyClientBuilder(baseContext)
  .addAppLifecycleHandling(getApplication())
  .build()
```

envoyproxy/envoy-mobile#721 will track this work.

As part of this PR, I also updated some documentation to better reflect the differences between Android/Java interfaces and those present on iOS.

## Testing

- Tested locally and verified that stats are flushed when backgrounding the iOS and Android sample apps
- Sample apps use this new mechanism

## Risk Level

Low, this is an additive change.

## Issues

Resolves envoyproxy/envoy-mobile#573

Signed-off-by: Michael Rebello <me@michaelrebello.com>
Signed-off-by: JP Simard <jp@jpsim.com>
jpsim pushed a commit that referenced this pull request Nov 29, 2022
## Description

This change adds the ability to automatically flush stats based on application lifecycle changes (in addition to the scheduled flushing interval).

Enabling this flushing system is done **automatically** when the iOS/Android clients are instantiated.

On **iOS**, this is done by observing `NSNotificationCenter`.

**Android** requires an `Application` context to use for registering lifecycle callbacks. To accommodate this, the `Application` is now passed in to the Android builder instead of the `Context`.

Right now this new stats flushing behavior is enabled by default. In the future, we would like to investigate making it optional using the builder pattern. For example:

```swift
EnvoyClientBuilder()
  .addAppLifecycleHandling()
  .build()
```

```kotlin
AndroidEnvoyClientBuilder(baseContext)
  .addAppLifecycleHandling(getApplication())
  .build()
```

envoyproxy/envoy-mobile#721 will track this work.

As part of this PR, I also updated some documentation to better reflect the differences between Android/Java interfaces and those present on iOS.

## Testing

- Tested locally and verified that stats are flushed when backgrounding the iOS and Android sample apps
- Sample apps use this new mechanism

## Risk Level

Low, this is an additive change.

## Issues

Resolves envoyproxy/envoy-mobile#573

Signed-off-by: Michael Rebello <me@michaelrebello.com>
Signed-off-by: JP Simard <jp@jpsim.com>
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.

None yet

2 participants