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

[TT-3972] Mark/skip problematic tests, resolve some root issues #4035

Merged
merged 55 commits into from
May 17, 2022

Conversation

titpetric
Copy link
Contributor

No description provided.

@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented May 5, 2022

API tests result: success
Branch used: refs/pull/4035/merge
Commit:
Triggered by: pull_request (@titpetric)
Execution page

@titpetric titpetric marked this pull request as draft May 5, 2022 21:02
@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented May 5, 2022

API tests result: success
Branch used: refs/pull/4035/merge
Commit: cc43665
Triggered by: pull_request (@titpetric)
Execution page

@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented May 5, 2022

API tests result: success
Branch used: refs/pull/4035/merge
Commit: 956c46d
Triggered by: pull_request (@titpetric)
Execution page

@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented May 5, 2022

API tests result: success
Branch used: refs/pull/4035/merge
Commit: f8d4329
Triggered by: pull_request (@titpetric)
Execution page

@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented May 5, 2022

API tests result: success
Branch used: refs/pull/4035/merge
Commit: 7989503
Triggered by: pull_request (@titpetric)
Execution page

@jeffy-mathew jeffy-mathew force-pushed the fix/TT-3972/flaky-tests-hotfixes branch from e46c668 to 9abaaf8 Compare May 6, 2022 09:12
@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented May 6, 2022

API tests result: success
Branch used: refs/pull/4035/merge
Commit: e46c668
Triggered by: pull_request (@jeffy-mathew)
Execution page

@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented May 6, 2022

API tests result: success
Branch used: refs/pull/4035/merge
Commit: 9abaaf8
Triggered by: pull_request (@jeffy-mathew)
Execution page

@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented May 6, 2022

API tests result: success
Branch used: refs/pull/4035/merge
Commit: 8127132
Triggered by: pull_request (@jeffy-mathew)
Execution page

@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented May 6, 2022

API tests result: success
Branch used: refs/pull/4035/merge
Commit: b2cb3b9
Triggered by: pull_request (@jeffy-mathew)
Execution page

@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented May 6, 2022

API tests result: success
Branch used: refs/pull/4035/merge
Commit: 67877f7
Triggered by: pull_request (@jeffy-mathew)
Execution page

@jeffy-mathew jeffy-mathew force-pushed the fix/TT-3972/flaky-tests-hotfixes branch from 042e554 to f403234 Compare May 6, 2022 10:11
@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented May 6, 2022

API tests result: success
Branch used: refs/pull/4035/merge
Commit: 042e554
Triggered by: pull_request (@jeffy-mathew)
Execution page

@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented May 6, 2022

API tests result: success
Branch used: refs/pull/4035/merge
Commit: f403234
Triggered by: pull_request (@jeffy-mathew)
Execution page

@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented May 6, 2022

API tests result: success
Branch used: refs/pull/4035/merge
Commit: 9011dfa
Triggered by: pull_request (@jeffy-mathew)
Execution page

@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented May 6, 2022

API tests result: success
Branch used: refs/pull/4035/merge
Commit: 58b304a
Triggered by: pull_request (@titpetric)
Execution page

@titpetric titpetric force-pushed the fix/TT-3972/flaky-tests-hotfixes branch from 58b304a to ea212d9 Compare May 6, 2022 12:59
@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented May 6, 2022

API tests result: success
Branch used: refs/pull/4035/merge
Commit: ea212d9
Triggered by: pull_request (@titpetric)
Execution page

@titpetric titpetric force-pushed the fix/TT-3972/flaky-tests-hotfixes branch from ea212d9 to 85bdb50 Compare May 6, 2022 14:19
@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented May 6, 2022

API tests result: success
Branch used: refs/pull/4035/merge
Commit: 85bdb50
Triggered by: pull_request (@titpetric)
Execution page

@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented May 6, 2022

API tests result: success
Branch used: refs/pull/4035/merge
Commit: f408724
Triggered by: pull_request (@titpetric)
Execution page

@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented May 9, 2022

API tests result: success
Branch used: refs/pull/4035/merge
Commit: 4d478f8
Triggered by: pull_request (@titpetric)
Execution page

@TykTechnologies TykTechnologies deleted a comment from github-actions bot May 9, 2022
@TykTechnologies TykTechnologies deleted a comment from github-actions bot May 9, 2022
@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented May 9, 2022

API tests result: success
Branch used: refs/pull/4035/merge
Commit: 5ba561b
Triggered by: pull_request (@titpetric)
Execution page

@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented May 9, 2022

API tests result: success
Branch used: refs/pull/4035/merge
Commit: e69fa5f
Triggered by: pull_request (@titpetric)
Execution page

echo "$@" >&2
exit 1
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Redundant redirect of stdout output into stderr

if [[ -z "$OPTS" ]]; then
OPTS="-race -count=1 -failfast -v"
fi

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ability to override test flags with ci-tests.sh arguments

@titpetric titpetric force-pushed the fix/TT-3972/flaky-tests-hotfixes branch from eba26e0 to 99bd4cf Compare May 17, 2022 09:58
@TykTechnologies TykTechnologies deleted a comment from github-actions bot May 17, 2022
@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented May 17, 2022

API tests result: success
Branch used: refs/pull/4035/merge
Commit: 465d542
Triggered by: pull_request (@titpetric)
Execution page

@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented May 17, 2022

API tests result: success
Branch used: refs/pull/4035/merge
Commit: 99bd4cf
Triggered by: pull_request (@titpetric)
Execution page

@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

44.6% 44.6% Coverage
0.0% 0.0% Duplication

@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented May 17, 2022

API tests result: success
Branch used: refs/pull/4035/merge
Commit: e4ddb50
Triggered by: pull_request (@titpetric)
Execution page

@titpetric titpetric merged commit 6d6e995 into master May 17, 2022
@titpetric titpetric deleted the fix/TT-3972/flaky-tests-hotfixes branch May 17, 2022 11:24
@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented May 17, 2022

API tests result: success
Branch used: refs/heads/master
Commit: 6d6e995 TT-3972 Mark/skip problematic tests, resolve some root issues (#4035)

  • Improve CI tests
  • Run go vet over whole repo, once
  • Avoid bash no-ops in favor of 'set -e'
  • Remove no-op stdout redirects
  • Fail fast with -failfast flag
  • No caching with -count=1 flag
  • Add testing utilities to mark Flaky and Racy tests with

  • Allow configuring python version for tests

  • Add debug output to print which python version we seek

  • Remove dead code, verified with @sredny

  • Mark TT-5220 flaky test

  • Mark TT-5222 flaky test

  • Mark TT-5223 flaky test

  • Resolve TT-5000, add cancellation ctx to redis to fix some racy tests

  • Mark TT-5224 as racy

  • Mark TT-5225 as racy

  • Add http client/transport utilities to avoid net.DefaultResolver

  • Fix: TT-5112 only replace defaultResolver once

Since we test packages individually, we can avoid DNS Mock data races by not resetting the DefaultResolver to it's original value.
While the ultimate goal is removal, we need to add replacements, which mostly add up to a Dialer function.

  • Use NewClientLocal where we know we have flaky tests caused by the DNS Mock

  • Tentative improvement for TT-5226, marking flaky tests

  • Fix TT-5227 by having a dirty dns mock shutdown

  • Mark TT-5228 as flaky

  • add test util function GetPythonVersion
    get python version from env in TestValueExtractorHeaderSource
    [changelog]
    added: test util function GetPythonVersion.

  • Mark TT-3973 as flaky

  • mark TT-4069 as flaky

  • fix flaky TT-4788

  • Mark TT-5233 as racy

  • mark TestHMACAuthSessionSHA512Pass as flaky TT-3973

  • Allow passing options to bin/ci-tests.sh for go test

  • Print notice test can be skipped with CI env

  • Remove unnecessary go background key deletion, race over b.store

  • Upgrade redis/v8 to get patches for all the data races

  • Mark TT-5236 as flaky

  • Fix goroutine leak in rpcReloadLoop

  • Fix: panic in tests if we can't connect to redis

  • Testing: add a console monitor for runtime stats, goroutines

  • Add flaky test to verify how many goroutines we leak in a test case

  • Remove running go-vet, it's run twice as part of golangci-lint

  • Mark TT-5249 as flaky

  • Mark flaky tests TT-5250, TT-5251

  • Remove unused *gateway.cancelFn

  • Mark TT-5254 flaky test

  • Mark TT-5257 as flaky, note frequency

  • Mark TT-5258 as flaky

  • Mark TT-5259 as flaky

  • Mark TT-5260 flaky, improve tests fragility

  • Fix: Improve flakyness in Gateway tests

  • Mark TT-5112, 5261, 5261 as flaky

  • Remove unnecessary time.Sleep values from tests, tests still pass

  • Add enabling of pprof server with TEST_PPROF_ENABLE and TEST_PPROF_ADDR (tests only)

  • Improve TestAPISpec_StripListenPath flakyness, Mark TT-5255 as flaky

  • Mark TT-5263 as flaky

  • Mark flaky tests, remove SkipEmptyRedis

  • Mark TT-5264 as flaky

  • Test utilities improvements (signficant):

  • disable the DNS mock (unsafe, TT-5112)
  • disable emptying redis from tests (race conditions as redis is a singleton with reuse)
  • some cleanup for readibility, s.Gw to gw (scope)
  • remove useless s.gwMu mock, cleaner test cancellation
  • Fix leaking pubsub channels, decrease deprecated redis api surface to use channels

  • Fix golangci-lint reported issues in modified code

  • Fix resource leak with time.After in tests, analytics records flusher

  • Removed TestAnalytics, fixing incorrect rebase

  • Add comment to explain why func is empty, sonarcloud

Co-authored-by: Jeff jeffy.mathew100@gmail.com
Triggered by: push (@titpetric)
Execution page

@tbuchaillot
Copy link
Contributor

@titpetric should this be merged to release-4 branch?

Copy link
Contributor

@urbanishimwe urbanishimwe left a comment

Choose a reason for hiding this comment

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

I think this should be checked later. I missed to address it.

m.NumGC = rtm.NumGC

// Just encode to json and print
b, _ := json.Marshal(m)
Copy link
Contributor

Choose a reason for hiding this comment

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

since its for stderr can we indent the json b, _ := json.MarshalIndent(&m, "", " ")

// Number of goroutines
m.NumGoroutine = runtime.NumGoroutine()
if m.NumGoroutine > 4000 {
go func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

this goroutine that handles SIGQUIT, might be dispatched multiples times(every timer + G > 4000) and I think we need it once, and it should return as long as the function returns

var rtm runtime.MemStats
var interval = time.Duration(duration) * time.Second
for {
<-time.After(interval)
Copy link
Contributor

Choose a reason for hiding this comment

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

we should add a context arguments, that will receive a signal to stop this function(stop monitoring), just in case. so we could basically select between timer and context deadline

// Number of goroutines
m.NumGoroutine = runtime.NumGoroutine()
if m.NumGoroutine > 4000 {
go func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

let's remove this nested function

test/init.go Show resolved Hide resolved
@Tyk-ITS
Copy link
Contributor

Tyk-ITS commented May 18, 2022

API tests result: skipped 🚫
Branch used: refs/heads/master
Commit: 6d6e995 TT-3972 Mark/skip problematic tests, resolve some root issues (#4035)

  • Improve CI tests
  • Run go vet over whole repo, once
  • Avoid bash no-ops in favor of 'set -e'
  • Remove no-op stdout redirects
  • Fail fast with -failfast flag
  • No caching with -count=1 flag
  • Add testing utilities to mark Flaky and Racy tests with

  • Allow configuring python version for tests

  • Add debug output to print which python version we seek

  • Remove dead code, verified with @sredny

  • Mark TT-5220 flaky test

  • Mark TT-5222 flaky test

  • Mark TT-5223 flaky test

  • Resolve TT-5000, add cancellation ctx to redis to fix some racy tests

  • Mark TT-5224 as racy

  • Mark TT-5225 as racy

  • Add http client/transport utilities to avoid net.DefaultResolver

  • Fix: TT-5112 only replace defaultResolver once

Since we test packages individually, we can avoid DNS Mock data races by not resetting the DefaultResolver to it's original value.
While the ultimate goal is removal, we need to add replacements, which mostly add up to a Dialer function.

  • Use NewClientLocal where we know we have flaky tests caused by the DNS Mock

  • Tentative improvement for TT-5226, marking flaky tests

  • Fix TT-5227 by having a dirty dns mock shutdown

  • Mark TT-5228 as flaky

  • add test util function GetPythonVersion
    get python version from env in TestValueExtractorHeaderSource
    [changelog]
    added: test util function GetPythonVersion.

  • Mark TT-3973 as flaky

  • mark TT-4069 as flaky

  • fix flaky TT-4788

  • Mark TT-5233 as racy

  • mark TestHMACAuthSessionSHA512Pass as flaky TT-3973

  • Allow passing options to bin/ci-tests.sh for go test

  • Print notice test can be skipped with CI env

  • Remove unnecessary go background key deletion, race over b.store

  • Upgrade redis/v8 to get patches for all the data races

  • Mark TT-5236 as flaky

  • Fix goroutine leak in rpcReloadLoop

  • Fix: panic in tests if we can't connect to redis

  • Testing: add a console monitor for runtime stats, goroutines

  • Add flaky test to verify how many goroutines we leak in a test case

  • Remove running go-vet, it's run twice as part of golangci-lint

  • Mark TT-5249 as flaky

  • Mark flaky tests TT-5250, TT-5251

  • Remove unused *gateway.cancelFn

  • Mark TT-5254 flaky test

  • Mark TT-5257 as flaky, note frequency

  • Mark TT-5258 as flaky

  • Mark TT-5259 as flaky

  • Mark TT-5260 flaky, improve tests fragility

  • Fix: Improve flakyness in Gateway tests

  • Mark TT-5112, 5261, 5261 as flaky

  • Remove unnecessary time.Sleep values from tests, tests still pass

  • Add enabling of pprof server with TEST_PPROF_ENABLE and TEST_PPROF_ADDR (tests only)

  • Improve TestAPISpec_StripListenPath flakyness, Mark TT-5255 as flaky

  • Mark TT-5263 as flaky

  • Mark flaky tests, remove SkipEmptyRedis

  • Mark TT-5264 as flaky

  • Test utilities improvements (signficant):

  • disable the DNS mock (unsafe, TT-5112)
  • disable emptying redis from tests (race conditions as redis is a singleton with reuse)
  • some cleanup for readibility, s.Gw to gw (scope)
  • remove useless s.gwMu mock, cleaner test cancellation
  • Fix leaking pubsub channels, decrease deprecated redis api surface to use channels

  • Fix golangci-lint reported issues in modified code

  • Fix resource leak with time.After in tests, analytics records flusher

  • Removed TestAnalytics, fixing incorrect rebase

  • Add comment to explain why func is empty, sonarcloud

Co-authored-by: Jeff jeffy.mathew100@gmail.com
Triggered by: push (@konrad-sol)
Execution page

titpetric added a commit that referenced this pull request Jun 2, 2022
* Improve CI tests

- Run go vet over whole repo, once
- Avoid bash no-ops in favor of 'set -e'
- Remove no-op stdout redirects
- Fail fast with -failfast flag
- No caching with -count=1 flag

* Add testing utilities to mark Flaky and Racy tests with

* Allow configuring python version for tests

* Add debug output to print which python version we seek

* Remove dead code, verified with @sredny

* Mark TT-5220 flaky test

* Mark TT-5222 flaky test

* Mark TT-5223 flaky test

* Resolve TT-5000, add cancellation ctx to redis to fix some racy tests

* Mark TT-5224 as racy

* Mark TT-5225 as racy

* Add http client/transport utilities to avoid net.DefaultResolver

* Fix: TT-5112 only replace defaultResolver once

Since we test packages individually, we can avoid DNS Mock data races by not resetting the DefaultResolver to it's original value.
While the ultimate goal is removal, we need to add replacements, which mostly add up to a Dialer function.

* Use NewClientLocal where we know we have flaky tests caused by the DNS Mock

* Tentative improvement for TT-5226, marking flaky tests

* Fix TT-5227 by having a dirty dns mock shutdown

* Mark TT-5228 as flaky

* add test util function GetPythonVersion
get python version from env in TestValueExtractorHeaderSource
[changelog]
added: test util function GetPythonVersion.

* Mark  TT-3973 as flaky

* mark TT-4069 as flaky

* fix flaky TT-4788

* Mark TT-5233 as racy

* mark TestHMACAuthSessionSHA512Pass as flaky TT-3973

* Allow passing options to bin/ci-tests.sh for go test

* Print notice test can be skipped with CI env

* Remove unnecessary go background key deletion, race over b.store

* Upgrade redis/v8 to get patches for all the data races

* Mark TT-5236 as flaky

* Fix goroutine leak in rpcReloadLoop

* Fix: panic in tests if we can't connect to redis

* Testing: add a console monitor for runtime stats, goroutines

* Add flaky test to verify how many goroutines we leak in a test case

* Remove running go-vet, it's run twice as part of golangci-lint

* Mark TT-5249 as flaky

* Mark flaky tests TT-5250, TT-5251

* Remove unused *gateway.cancelFn

* Mark TT-5254 flaky test

* Mark TT-5257 as flaky, note frequency

* Mark TT-5258 as flaky

* Mark TT-5259 as flaky

* Mark TT-5260 flaky, improve tests fragility

* Fix: Improve flakyness in Gateway tests

* Mark TT-5112, 5261, 5261 as flaky

* Remove unnecessary time.Sleep values from tests, tests still pass

* Add enabling of pprof server with TEST_PPROF_ENABLE and TEST_PPROF_ADDR (tests only)

* Improve TestAPISpec_StripListenPath flakyness, Mark TT-5255 as flaky

* Mark TT-5263 as flaky

* Mark flaky tests, remove SkipEmptyRedis

* Mark TT-5264 as flaky

* Test utilities improvements (signficant):

- disable the DNS mock (unsafe, TT-5112)
- disable emptying redis from tests (race conditions as redis is a singleton with reuse)
- some cleanup for readibility, s.Gw to gw (scope)
- remove useless s.gwMu mock, cleaner test cancellation

* Fix leaking pubsub channels, decrease deprecated redis api surface to use channels

* Fix golangci-lint reported issues in modified code

* Fix resource leak with time.After in tests, analytics records flusher

* Removed TestAnalytics, fixing incorrect rebase

* Add comment to explain why func is empty, sonarcloud

Co-authored-by: Jeff <jeffy.mathew100@gmail.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.

8 participants