Skip to content

Commit

Permalink
chore: fixing skip flaky test logic (#1734)
Browse files Browse the repository at this point in the history
## Description:
fixing skip flaky test logic

## Is this change user facing?
NO

## References (if applicable):
fixing this PR: #1732
  • Loading branch information
leoporoli authored Nov 9, 2023
1 parent 9959d8c commit a559ae2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 2 additions & 1 deletion internal_testsuites/golang/test_helpers/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,8 @@ func getServiceWithLogLinesServiceConfigStarlark(logLines []string) string {
}

func SkipFlakyTest(t *testing.T, testName string) {
if skipFlakyTestStartDate.Before(oneWeekAfterStartDate) {
now := time.Now()
if now.Before(oneWeekAfterStartDate) {
t.Skipf("Skipping %s, because it is too noisy, until %s or until we fix the flakyness", testName, oneWeekAfterStartDate)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ const DEFAULT_SHOULD_RETURN_ALL_LOGS = true
const DEFAULT_NUM_LOG_LINES = 0 // this value doesn't matter since default is to return all logs

// skip flaky tests period

const SKIP_FLAKY_TEST_START_DATE = new Date('2023-11-09');
const ONE_WEEK_AFTER_START_DATE = new Date('2023-11-17');
const SKIP_FLAKY_TEST_END_DATE = new Date('2023-11-17');


// for validating data store is healthy
Expand Down Expand Up @@ -614,8 +612,9 @@ function getServiceWithLogLinesConfig(logLines: ServiceLog[]): string {
}

export function shouldSkipFlakyTest(testName: string): boolean {
if (SKIP_FLAKY_TEST_START_DATE < ONE_WEEK_AFTER_START_DATE) {
log.info(`Skipping ${testName}, because it is too noisy, until ${ONE_WEEK_AFTER_START_DATE} or until we fix the flakyness`)
const now = new Date()
if (now < SKIP_FLAKY_TEST_END_DATE) {
log.info(`Skipping ${testName}, because it is too noisy, until ${SKIP_FLAKY_TEST_END_DATE} or until we fix the flakyness`)
return true
}
return false
Expand Down

0 comments on commit a559ae2

Please sign in to comment.