Skip to content

Commit 1ae9ab6

Browse files
authored
[Integration testing] Remove AltErr and only expect 400 from ES bulk API (#4012)
* Remove AltErr * Fixed error type
1 parent deefa2d commit 1ae9ab6

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

internal/pkg/bulk/bulk_integration_test.go

+5-12
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,10 @@ func TestBulkCreate(t *testing.T) {
2828
index, bulker := SetupIndexWithBulk(ctx, t, testPolicy, WithFlushThresholdCount(1))
2929

3030
tests := []struct {
31-
Name string
32-
Index string
33-
ID string
34-
Err error
35-
AltErr error // FIXME: workaround until https://elasticco.atlassian.net/browse/ES-9711 is resolved
31+
Name string
32+
Index string
33+
ID string
34+
Err error
3635
}{
3736
{
3837
Name: "Empty Id",
@@ -70,10 +69,6 @@ func TestBulkCreate(t *testing.T) {
7069
Name: "Invalid utf-8",
7170
Index: string([]byte{0xfe, 0xfe, 0xff, 0xff}),
7271
Err: es.ErrElastic{
73-
Status: 500,
74-
Type: "json_parse_exception",
75-
},
76-
AltErr: es.ErrElastic{
7772
Status: 400,
7873
Type: "parse_exception",
7974
},
@@ -105,9 +100,7 @@ func TestBulkCreate(t *testing.T) {
105100
// Create
106101
id, err := bulker.Create(ctx, test.Index, test.ID, sampleData)
107102
if !EqualElastic(test.Err, err) {
108-
if test.AltErr == nil || !EqualElastic(test.AltErr, err) {
109-
t.Fatalf("expected error: %+v (alt: %+v), got: %+v", test.Err, test.AltErr, err)
110-
}
103+
t.Fatalf("expected error: %+v, got: %+v", test.Err, err)
111104
}
112105
if err != nil {
113106
return

0 commit comments

Comments
 (0)