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

roachtest: acceptance subtests interact poorly with teamcity-post-failures.py #30548

Closed
tbg opened this issue Sep 24, 2018 · 8 comments
Closed
Assignees
Labels
A-testing Testing tools and infrastructure C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) no-issue-activity X-stale

Comments

@tbg
Copy link
Member

tbg commented Sep 24, 2018

We group all acceptance roachtests into an umbrella test. This means that when teamcity-post-failures.py posts an issue, it will never reference the test that actually failed in the title but instead create useless barrages of issues like these:

image

Arguably the python issue poster is pretty bad anyway, but this is something that the roachtests get wrong. We've taught our issue poster to not create multiple issues for subtests, but in roachtest/acceptance we do want that.

Do we want to introduce an extra layer that determines on a per-entity basis whether subtests are to be spelled out? We could do so via an env var in the build. Any other ideas?

cc @petermattis

@tbg tbg added the A-testing Testing tools and infrastructure label Sep 24, 2018
@tbg tbg changed the title roachtest: revisit acceptance subtests roachtest: acceptance subtests interact poorly with teamcity-post-failures.py Sep 24, 2018
@tbg
Copy link
Member Author

tbg commented Sep 24, 2018

Perhaps the right thing to do here is to not group subtests out any more, and to instead change the tests that create spurious issues instead. That might be more manageable than putting implicit assumptions that are kind of easy to break everywhere.

tbg added a commit to tbg/cockroach that referenced this issue Sep 24, 2018
Teach it to

1. group subtests into their parent
2. with the exception of acceptance
3. better test output

Touches cockroachdb#30548.

See these links for example output:

#135
#136
#137
#138

As documentation for future changes to this script, here's how to set it
up for testing locally.

```
// export TC_BUILD_ID=918035
// export TC_BUILD_ID=900331
export TC_BUILD_ID=864629
export GITHUB_API_TOKEN=...
export TC_BUILD_BRANCH=release-banana
export TC_API_PASSWORD=...
```

```diff
diff --git a/build/teamcity-post-failures.py b/build/teamcity-post-failures.py
index 229c800c32..f47539340a 100755
--- a/build/teamcity-post-failures.py
+++ b/build/teamcity-post-failures.py
@@ -24,7 +24,7 @@ BASEURL = "https://teamcity.cockroachdb.com/httpAuth/app/rest/"
 auth_handler = urllib.request.HTTPBasicAuthHandler()
 auth_handler.add_password(realm='TeamCity',
                           uri='https://teamcity.cockroachdb.com',
-                          user='robot',
+                          user='tschottdorf',
                           passwd=os.environ['TC_API_PASSWORD'])
 opener = urllib.request.build_opener(auth_handler)

@@ -62,6 +62,8 @@ def collect_build_results(build_id):
         yield (test_name, test_log, category)

 def get_probable_milestone():
+    # HACK
+    return None
     try:
         tag = subprocess.check_output(['git', 'describe', '--abbrev=0', '--tags'],
             universal_newlines=True)
@@ -128,7 +130,7 @@ Please assign, take a look and update the issue accordingly.

 def post_issue(issue):
     req = urllib.request.Request(
-        'https://api.github.com/repos/cockroachdb/cockroach/issues',
+        'https://api.github.com/repos/tschottdorf/cockroach/issues',
         data=json.dumps(issue).encode('utf-8'),
         headers={'Authorization': 'token {0}'.format(os.environ['GITHUB_API_TOKEN'])})
     try:
```

Release note: None
craig bot pushed a commit that referenced this issue Sep 24, 2018
30542: security: remove some dead code r=mberhault a=benesch



30549: build: update teamcity-post-failures.py r=benesch a=tschottdorf

Teach it to

1. group subtests into their parent
2. with the exception of acceptance
3. better test output

Touches #30548.

See these links for example output:

tbg#135
tbg#136
tbg#137
tbg#138

As documentation for future changes to this script, here's how to set it
up for testing locally.

```
// export TC_BUILD_ID=918035
// export TC_BUILD_ID=900331
export TC_BUILD_ID=864629
export GITHUB_API_TOKEN=...
export TC_BUILD_BRANCH=release-banana
export TC_API_PASSWORD=...
```

```diff
diff --git a/build/teamcity-post-failures.py b/build/teamcity-post-failures.py
index 229c800c32..f47539340a 100755
--- a/build/teamcity-post-failures.py
+++ b/build/teamcity-post-failures.py
@@ -24,7 +24,7 @@ BASEURL = "https://teamcity.cockroachdb.com/httpAuth/app/rest/"
 auth_handler = urllib.request.HTTPBasicAuthHandler()
 auth_handler.add_password(realm='TeamCity',
                           uri='https://teamcity.cockroachdb.com',
-                          user='robot',
+                          user='tschottdorf',
                           passwd=os.environ['TC_API_PASSWORD'])
 opener = urllib.request.build_opener(auth_handler)

@@ -62,6 +62,8 @@ def collect_build_results(build_id):
         yield (test_name, test_log, category)

 def get_probable_milestone():
+    # HACK
+    return None
     try:
         tag = subprocess.check_output(['git', 'describe', '--abbrev=0', '--tags'],
             universal_newlines=True)
@@ -128,7 +130,7 @@ Please assign, take a look and update the issue accordingly.

 def post_issue(issue):
     req = urllib.request.Request(
-        'https://api.github.com/repos/cockroachdb/cockroach/issues',
+        'https://api.github.com/repos/tschottdorf/cockroach/issues',
         data=json.dumps(issue).encode('utf-8'),
         headers={'Authorization': 'token {0}'.format(os.environ['GITHUB_API_TOKEN'])})
     try:
```

Release note: None

Co-authored-by: Nikhil Benesch <nikhil.benesch@gmail.com>
Co-authored-by: Tobias Schottdorf <tobias.schottdorf@gmail.com>
@petermattis
Copy link
Collaborator

Couldn't we have roachtest post these issues? I think that is just a bit of env var setup. I know you were wondering why roachtest posts issues directly elsewhere, but it seems to be easily solvable in roachtest vs more awkwardly solvable externally.

@tbg
Copy link
Member Author

tbg commented Sep 24, 2018

One "problem" here is that by saying that roachtest will post its own failures, we have to teach the other scripts to ignore failures from roachtest. That is doable as well, but before deciding one way or another I want to double check which solution results in the fewest headaches. Consider the argument:

  1. we've basically rewritten a good amount of the go test framework outside of go already and are unlikely to back out of that, and so
  2. we have and will always have output in the Go test format, and so
  3. we should be using our existing infra that eats Go test output and not add yet another set of code to maintain

On the other hand, roachtest failures are different from other failures (they don't want a stressrace invocation, not sure if there are other differences)

Your argument for posting failures as they occur and not much later is reasonable, though I personally prefer it the other way (less interruptions).

@petermattis
Copy link
Collaborator

we should be using our existing infra that eats Go test output and not add yet another set of code to maintain

On the bright side, roachtest does share the issue posting code with with github-post. I thought @benesch wanted to get rid of this python code at some point. Perhaps I'm misremembering.

Your argument for posting failures as they occur and not much later is reasonable, though I personally prefer it the other way (less interruptions).

Btw, this is less of a concern now that we've broken the most egregiously long running roachtests into smaller pieces (i.e. jepsen).

@benesch
Copy link
Contributor

benesch commented Sep 24, 2018

On the bright side, roachtest does share the issue posting code with with github-post. I thought @benesch wanted to get rid of this python code at some point. Perhaps I'm misremembering.

You're not misremembering. I think @tschottdorf's plan is to rewrite that Python script as a simple wrapper around the github-post package.

tbg added a commit to tbg/cockroach that referenced this issue Sep 25, 2018
Teach it to

1. group subtests into their parent
2. with the exception of acceptance
3. better test output

Touches cockroachdb#30548.

See these links for example output:

#135
#136
#137
#138

As documentation for future changes to this script, here's how to set it
up for testing locally.

```
// export TC_BUILD_ID=918035
// export TC_BUILD_ID=900331
export TC_BUILD_ID=864629
export GITHUB_API_TOKEN=...
export TC_BUILD_BRANCH=release-banana
export TC_API_PASSWORD=...
```

```diff
diff --git a/build/teamcity-post-failures.py b/build/teamcity-post-failures.py
index 229c800c32..f47539340a 100755
--- a/build/teamcity-post-failures.py
+++ b/build/teamcity-post-failures.py
@@ -24,7 +24,7 @@ BASEURL = "https://teamcity.cockroachdb.com/httpAuth/app/rest/"
 auth_handler = urllib.request.HTTPBasicAuthHandler()
 auth_handler.add_password(realm='TeamCity',
                           uri='https://teamcity.cockroachdb.com',
-                          user='robot',
+                          user='tschottdorf',
                           passwd=os.environ['TC_API_PASSWORD'])
 opener = urllib.request.build_opener(auth_handler)

@@ -62,6 +62,8 @@ def collect_build_results(build_id):
         yield (test_name, test_log, category)

 def get_probable_milestone():
+    # HACK
+    return None
     try:
         tag = subprocess.check_output(['git', 'describe', '--abbrev=0', '--tags'],
             universal_newlines=True)
@@ -128,7 +130,7 @@ Please assign, take a look and update the issue accordingly.

 def post_issue(issue):
     req = urllib.request.Request(
-        'https://api.github.com/repos/cockroachdb/cockroach/issues',
+        'https://api.github.com/repos/tschottdorf/cockroach/issues',
         data=json.dumps(issue).encode('utf-8'),
         headers={'Authorization': 'token {0}'.format(os.environ['GITHUB_API_TOKEN'])})
     try:
```

Release note: None
tbg added a commit to tbg/cockroach that referenced this issue Sep 25, 2018
This code looked bad before and it hasn't gotten any better, but this
should prevent new bogus issues like cockroachdb#30595.

There's discussion in cockroachdb#30548 on revamping this, but right now band aid
is what's on the menu.

Release note: None
craig bot pushed a commit that referenced this issue Sep 25, 2018
30629: build: in python issue poster, ignore roachtest/acceptance r=petermattis a=tschottdorf

This code looked bad before and it hasn't gotten any better, but this
should prevent new bogus issues like #30595.

There's discussion in #30548 on revamping this, but right now band aid
is what's on the menu.

Closes #30595.

Release note: None

Co-authored-by: Tobias Schottdorf <tobias.schottdorf@gmail.com>
tbg added a commit to tbg/cockroach that referenced this issue Sep 29, 2018
This code looked bad before and it hasn't gotten any better, but this
should prevent new bogus issues like cockroachdb#30595.

There's discussion in cockroachdb#30548 on revamping this, but right now band aid
is what's on the menu.

Release note: None
@knz knz added the C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) label Oct 3, 2018
@petermattis
Copy link
Collaborator

@andreimatei Tossing your way because I believe your plan is to get rid of subtests.

@andreimatei
Copy link
Contributor

I am getting rid of subtests indeed, but that won't, in itself, affect the output. As long as a test's name is "acceptance/foo" (be it a roachtest subtest or not), I imagine that this python script will do what it does now.
Tossing this back to... Tobi as... the owner of the python script :P
For acceptance in particular, we could stop naming tests "acceptance/foo", as I don't think the prefix adds anything.
But in general we do have tests named "tpcc/foo" and "schemachange/foo". I don't know how we want issues grouped for these.

Btw, as the discussion below showed, there's a difference between how issues are filed for the nightly roachtest run (which doesn't use this python script) versus the roachtests that run on merge.
https://groups.google.com/a/cockroachlabs.com/d/msgid/eng/CAPqkKgmFp4wRU%2BVxFwoFDngF3b_84s67WP7XfFE14ENEYB%3DLow%40mail.gmail.com.

@github-actions
Copy link

github-actions bot commented Jun 5, 2021

We have marked this issue as stale because it has been inactive for
18 months. If this issue is still relevant, removing the stale label
or adding a comment will keep it active. Otherwise, we'll close it in
5 days to keep the issue queue tidy. Thank you for your contribution
to CockroachDB!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testing Testing tools and infrastructure C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) no-issue-activity X-stale
Projects
None yet
Development

No branches or pull requests

5 participants