Skip to content

fix flaky test and unit_race failure#5187

Merged
deepthi merged 2 commits intovitessio:masterfrom
planetscale:ds-fix-flaky-test
Sep 13, 2019
Merged

fix flaky test and unit_race failure#5187
deepthi merged 2 commits intovitessio:masterfrom
planetscale:ds-fix-flaky-test

Conversation

@deepthi
Copy link
Collaborator

@deepthi deepthi commented Sep 13, 2019

TestBuildPlayerPlanNoDup is failing intermittently because the order of tables in the error message varies.
This PR changes the asserting to check for a substring instead of an exact match.

Before:

~/go/src/vitess.io/vitess/go/vt/vttablet/tabletmanager/vreplication$ for i in {1..10}
> do
> go test -run NoDup
> done
PASS
ok  	vitess.io/vitess/go/vt/vttablet/tabletmanager/vreplication	7.037s
PASS
ok  	vitess.io/vitess/go/vt/vttablet/tabletmanager/vreplication	5.836s
PASS
ok  	vitess.io/vitess/go/vt/vttablet/tabletmanager/vreplication	6.762s
PASS
ok  	vitess.io/vitess/go/vt/vttablet/tabletmanager/vreplication	5.972s
--- FAIL: TestBuildPlayerPlanNoDup (0.00s)
    replicator_plan_test.go:674: 
        	Error Trace:	replicator_plan_test.go:674
        	Error:      	Error message not equal:
        	            	expected: "more than one target for source table t: t1 and t2"
        	            	actual  : "more than one target for source table t: t2 and t1"
        	Test:       	TestBuildPlayerPlanNoDup
FAIL
exit status 1
FAIL	vitess.io/vitess/go/vt/vttablet/tabletmanager/vreplication	5.852s
PASS
ok  	vitess.io/vitess/go/vt/vttablet/tabletmanager/vreplication	5.848s
PASS
ok  	vitess.io/vitess/go/vt/vttablet/tabletmanager/vreplication	5.790s
PASS
ok  	vitess.io/vitess/go/vt/vttablet/tabletmanager/vreplication	6.777s
--- FAIL: TestBuildPlayerPlanNoDup (0.00s)
    replicator_plan_test.go:674: 
        	Error Trace:	replicator_plan_test.go:674
        	Error:      	Error message not equal:
        	            	expected: "more than one target for source table t: t1 and t2"
        	            	actual  : "more than one target for source table t: t2 and t1"
        	Test:       	TestBuildPlayerPlanNoDup
FAIL
exit status 1
FAIL	vitess.io/vitess/go/vt/vttablet/tabletmanager/vreplication	5.870s
PASS
ok  	vitess.io/vitess/go/vt/vttablet/tabletmanager/vreplication	5.699s

After:

~/go/src/vitess.io/vitess/go/vt/vttablet/tabletmanager/vreplication$ for i in {1..10}; do go test -run NoDup; done
PASS
ok  	vitess.io/vitess/go/vt/vttablet/tabletmanager/vreplication	6.055s
PASS
ok  	vitess.io/vitess/go/vt/vttablet/tabletmanager/vreplication	4.838s
PASS
ok  	vitess.io/vitess/go/vt/vttablet/tabletmanager/vreplication	5.715s
PASS
ok  	vitess.io/vitess/go/vt/vttablet/tabletmanager/vreplication	5.822s
PASS
ok  	vitess.io/vitess/go/vt/vttablet/tabletmanager/vreplication	6.896s
PASS
ok  	vitess.io/vitess/go/vt/vttablet/tabletmanager/vreplication	5.966s
PASS
ok  	vitess.io/vitess/go/vt/vttablet/tabletmanager/vreplication	5.974s
PASS
ok  	vitess.io/vitess/go/vt/vttablet/tabletmanager/vreplication	7.005s
PASS
ok  	vitess.io/vitess/go/vt/vttablet/tabletmanager/vreplication	6.004s
PASS
ok  	vitess.io/vitess/go/vt/vttablet/tabletmanager/vreplication	6.717s

Signed-off-by: deepthi deepthi@planetscale.com

@deepthi deepthi requested a review from sougou as a code owner September 13, 2019 03:20
Copy link
Contributor

@sougou sougou left a comment

Choose a reason for hiding this comment

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

Heh. I had fixed this in my branch. I'll undo it on my side.

@deepthi deepthi changed the title fix flaky test fix flaky test and unit_race failure Sep 13, 2019
@deepthi
Copy link
Collaborator Author

deepthi commented Sep 13, 2019

Also fix unit_race failure in CI.

Signed-off-by: deepthi <deepthi@planetscale.com>
Signed-off-by: deepthi <deepthi@planetscale.com>
@deepthi
Copy link
Collaborator Author

deepthi commented Sep 13, 2019

rebased to get #5185

@deepthi deepthi merged commit 2bf60f2 into vitessio:master Sep 13, 2019
@enisoc enisoc deleted the ds-fix-flaky-test branch September 13, 2019 17:28
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.

2 participants