-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Hentioe
committed
May 3, 2018
1 parent
3347d60
commit 6f14f6d
Showing
6 changed files
with
91 additions
and
22 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package main | ||
|
||
import ( | ||
"strconv" | ||
"errors" | ||
"fmt" | ||
"testing" | ||
|
||
"github.com/go-resty/resty" | ||
) | ||
|
||
func TestConcurrency(t *testing.T) { | ||
for i :=16; i > 0; i-- { | ||
resp, err := resty.R(). | ||
SetHeader("Content-Type", "application/json"). | ||
SetBody(`{"sentences":["` + strconv.Itoa(i) + `第一句","第二句","第三句","第四句","第五句","第六句","第七句","第八句","第九句"]}`). | ||
Post("http://localhost:8080/task/generate/sorry") | ||
if err != nil { | ||
t.Error(err) | ||
} | ||
if resp.StatusCode() != 200 { | ||
t.Error(errors.New(fmt.Sprintf("http err status: %d", resp.StatusCode()))) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters