Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
39375: exec: add null handling to default sorter r=rohany a=rohany

Addresses part of #36880.

Release note: None

39420: roachtest: fix pgjdbc tests r=rafiss a=rafiss

The pgjdbc tests have two types of failures: one referred to as
"failures" and the other one as "errors." We were only counting the
former before. Now there are many more test failures that should be
tracked in the blacklist.

touches #39406 

Release note: None

39430: workload/ycsb: implement read-modify-write r=jeffrey-xiao a=jeffrey-xiao

Release note: None

39461: internal/sqlsmith: add vectorize option r=mjibson a=mjibson

This option attempts to limits query generation such that vectorized
execution will occur. Still a lot of work to do but this is a good start.

Release note: None

Co-authored-by: Rohan Yadav <[email protected]>
Co-authored-by: Rafi Shamim <[email protected]>
Co-authored-by: Jeffrey Xiao <[email protected]>
Co-authored-by: Matt Jibson <[email protected]>
  • Loading branch information
5 people committed Aug 8, 2019
5 parents 3d6a1eb + 3efa0ee + 77171bc + 6bec279 + e682d69 commit de0ba56
Show file tree
Hide file tree
Showing 18 changed files with 5,377 additions and 124 deletions.
16 changes: 14 additions & 2 deletions pkg/cmd/roachtest/hibernate.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ func registerHibernate(r *testRegistry) {
var passUnexpectedCount, passExpectedCount, notRunCount int
// Put all the results in a giant map of [testname]result
results := make(map[string]string)
// Put all issue hints in a map of [testname]issue
allIssueHints := make(map[string]string)
// Current failures are any tests that reported as failed, regardless of if
// they were expected or not.
var currentFailures, allTests []string
Expand Down Expand Up @@ -207,10 +209,13 @@ func registerHibernate(r *testRegistry) {
if err != nil {
t.Fatal(err)
}
tests, passed, err := extractFailureFromJUnitXML(fileOutput)
tests, passed, issueHints, err := extractFailureFromJUnitXML(fileOutput)
if err != nil {
t.Fatal(err)
}
for testName, issue := range issueHints {
allIssueHints[testName] = issue
}
for i, test := range tests {
// There is at least a single test that's run twice, so if we already
// have a result, skip it.
Expand All @@ -219,6 +224,9 @@ func registerHibernate(r *testRegistry) {
}
allTests = append(allTests, test)
issue, expectedFailure := expectedFailures[test]
if len(issue) == 0 || issue == "unknown" {
issue = issueHints[test]
}
pass := passed[i]
switch {
case pass && !expectedFailure:
Expand All @@ -236,7 +244,8 @@ func registerHibernate(r *testRegistry) {
failExpectedCount++
currentFailures = append(currentFailures, test)
case !pass && !expectedFailure:
results[test] = fmt.Sprintf("--- FAIL: %s (unexpected)", test)
results[test] = fmt.Sprintf("--- FAIL: %s - %s (unexpected)",
test, maybeAddGithubLink(issue))
failUnexpectedCount++
currentFailures = append(currentFailures, test)
}
Expand Down Expand Up @@ -298,6 +307,9 @@ func registerHibernate(r *testRegistry) {
fmt.Fprintf(&b, "var %s = blacklist{\n", blacklistName)
for _, test := range currentFailures {
issue := expectedFailures[test]
if len(issue) == 0 || issue == "unknown" {
issue = allIssueHints[test]
}
if len(issue) == 0 {
issue = "unknown"
}
Expand Down
40 changes: 35 additions & 5 deletions pkg/cmd/roachtest/java_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,30 @@ package main
import (
"encoding/xml"
"fmt"
"regexp"
)

func extractFailureFromJUnitXML(contents []byte) ([]string, []bool, error) {
var issueRegexp = regexp.MustCompile(`See: https://github.com/cockroachdb/cockroach/issues/(\d+)`)

// extractFailureFromJUnitXML parses an XML report to find all failed tests. The
// return values are:
// - slice of all test names.
// - slice of bool for each test, with true indicating pass.
// - map from name of a failed test to a github issue that explains the failure,
// if the error message contained a reference to an issue.
// - error if there was a problem parsing the XML.
func extractFailureFromJUnitXML(contents []byte) ([]string, []bool, map[string]string, error) {
type Failure struct {
Message string `xml:"message,attr"`
}
type Error struct {
Message string `xml:"message,attr"`
}
type TestCase struct {
Name string `xml:"name,attr"`
ClassName string `xml:"classname,attr"`
Failure Failure `xml:"failure,omitempty"`
Error Error `xml:"error,omitempty"`
}
type TestSuite struct {
XMLName xml.Name `xml:"testsuite"`
Expand All @@ -33,15 +47,31 @@ func extractFailureFromJUnitXML(contents []byte) ([]string, []bool, error) {
_ = testSuite.XMLName

if err := xml.Unmarshal(contents, &testSuite); err != nil {
return nil, nil, err
return nil, nil, nil, err
}

var tests []string
var passed []bool
var failedTestToIssue = make(map[string]string)
for _, testCase := range testSuite.TestCases {
tests = append(tests, fmt.Sprintf("%s.%s", testCase.ClassName, testCase.Name))
passed = append(passed, len(testCase.Failure.Message) == 0)
testName := fmt.Sprintf("%s.%s", testCase.ClassName, testCase.Name)
testPassed := len(testCase.Failure.Message) == 0 && len(testCase.Error.Message) == 0
tests = append(tests, testName)
passed = append(passed, testPassed)
if !testPassed {
message := testCase.Failure.Message
if len(message) == 0 {
message = testCase.Error.Message
}

issue := "unknown"
match := issueRegexp.FindStringSubmatch(message)
if match != nil {
issue = match[1]
}
failedTestToIssue[testName] = issue
}
}

return tests, passed, nil
return tests, passed, failedTestToIssue, nil
}
16 changes: 14 additions & 2 deletions pkg/cmd/roachtest/pgjdbc.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ func registerPgjdbc(r *testRegistry) {
var passUnexpectedCount, passExpectedCount, notRunCount int
// Put all the results in a giant map of [testname]result
results := make(map[string]string)
// Put all issue hints in a map of [testname]issue
allIssueHints := make(map[string]string)
// Current failures are any tests that reported as failed, regardless of if
// they were expected or not.
var currentFailures, allTests []string
Expand Down Expand Up @@ -193,10 +195,13 @@ func registerPgjdbc(r *testRegistry) {
if err != nil {
t.Fatal(err)
}
tests, passed, err := extractFailureFromJUnitXML(fileOutput)
tests, passed, issueHints, err := extractFailureFromJUnitXML(fileOutput)
if err != nil {
t.Fatal(err)
}
for testName, issue := range issueHints {
allIssueHints[testName] = issue
}
for i, test := range tests {
// There is at least a single test that's run twice, so if we already
// have a result, skip it.
Expand All @@ -205,6 +210,9 @@ func registerPgjdbc(r *testRegistry) {
}
allTests = append(allTests, test)
issue, expectedFailure := expectedFailures[test]
if len(issue) == 0 || issue == "unknown" {
issue = issueHints[test]
}
pass := passed[i]
switch {
case pass && !expectedFailure:
Expand All @@ -222,7 +230,8 @@ func registerPgjdbc(r *testRegistry) {
failExpectedCount++
currentFailures = append(currentFailures, test)
case !pass && !expectedFailure:
results[test] = fmt.Sprintf("--- FAIL: %s (unexpected)", test)
results[test] = fmt.Sprintf("--- FAIL: %s - %s (unexpected)",
test, maybeAddGithubLink(issue))
failUnexpectedCount++
currentFailures = append(currentFailures, test)
}
Expand Down Expand Up @@ -283,6 +292,9 @@ func registerPgjdbc(r *testRegistry) {
fmt.Fprintf(&b, "var %s = blacklist{\n", blacklistName)
for _, test := range currentFailures {
issue := expectedFailures[test]
if len(issue) == 0 || issue == "unknown" {
issue = allIssueHints[test]
}
if len(issue) == 0 {
issue = "unknown"
}
Expand Down
Loading

0 comments on commit de0ba56

Please sign in to comment.