Skip to content

Commit

Permalink
Remove pointer to JobConfig in RepoData struct to fix memory bug (kna…
Browse files Browse the repository at this point in the history
…tive#795)

* Remove pointer to JobConfig in RepoData struct to fix memory bug

* Remove pointer to JobConfig in RepoData struct to fix memory bug
  • Loading branch information
TrevorFarrelly authored and knative-prow-robot committed May 17, 2019
1 parent 8daf339 commit 2aecb26
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tools/flaky-test-reporter/github_issue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func createNewIssue(fgi *GithubIssue, title, body, testStat string) (*github.Iss
}

func createRepoData(passed, flaky, failed, notenoughdata int, startTime int64) *RepoData {
config := &JobConfig{
config := JobConfig{
Repo: fakeRepo,
}
tss := map[string]*TestStat{}
Expand Down
2 changes: 1 addition & 1 deletion tools/flaky-test-reporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func main() {

for _, jc := range jobConfigs {
log.Printf("collecting results for repo '%s'\n", jc.Repo)
rd, err := collectTestResultsForRepo(&jc)
rd, err := collectTestResultsForRepo(jc)
if nil != err {
log.Fatalf("Error collecting results for repo '%s': %v", jc.Repo, err)
}
Expand Down
4 changes: 2 additions & 2 deletions tools/flaky-test-reporter/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const (

// RepoData struct contains all configurations and test results for a repo
type RepoData struct {
Config *JobConfig
Config JobConfig
TestStats map[string]*TestStat // key is test full name
BuildIDs []int // all build IDs scanned in this run
LastBuildStartTime *int64 // timestamp, determines how fresh the data is
Expand Down Expand Up @@ -169,7 +169,7 @@ func getCombinedResultsForBuild(build *prow.Build) ([]*junit.TestSuites, error)

// collectTestResultsForRepo collects test results, build IDs from all builds,
// as well as LastBuildStartTime, and stores them in RepoData
func collectTestResultsForRepo(jc *JobConfig) (*RepoData, error) {
func collectTestResultsForRepo(jc JobConfig) (*RepoData, error) {
rd := &RepoData{Config: jc}
job := prow.NewJob(jc.Name, jc.Type, jc.Repo, 0)
if !job.PathExists() {
Expand Down

0 comments on commit 2aecb26

Please sign in to comment.