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

Fix unit test failure of semaphore and cluster #110

Merged
merged 3 commits into from
Jul 8, 2021
Merged

Fix unit test failure of semaphore and cluster #110

merged 3 commits into from
Jul 8, 2021

Conversation

benja-wu
Copy link
Contributor

@benja-wu benja-wu commented Jul 7, 2021

  1. Changing to use golang.org/x/sync.sem instead of implementing it by ourselves with chan struct{}.
  2. Had run make test successfully in MacBook env.
49.474833ms
/abc/com/merchant/*/other/30/details
--- PASS: TestURLClusterAnalyzer (0.05s)
PASS
ok  	github.com/megaease/easegress/pkg/util/urlclusteranalyzer	(cached)
=== RUN   TestURLRULEMatch
--- PASS: TestURLRULEMatch (0.00s)
=== RUN   TestURLRegxMatch
--- PASS: TestURLRegxMatch (0.00s)
=== RUN   TestURLExactMatch
--- PASS: TestURLExactMatch (0.00s)
=== RUN   TestURLExactNotMatch
--- PASS: TestURLExactNotMatch (0.00s)
=== RUN   TestURLPrefixNotMatch
--- PASS: TestURLPrefixNotMatch (0.00s)
=== RUN   TestURLRULENoMatchMethod
--- PASS: TestURLRULENoMatchMethod (0.00s)
=== RUN   TestURLRULENoMatchURL
--- PASS: TestURLRULENoMatchURL (0.00s)
PASS
ok  	github.com/megaease/easegress/pkg/util/urlrule	(cached)
?   	github.com/megaease/easegress/pkg/util/yamltool	[no test files]
?   	github.com/megaease/easegress/pkg/v	[no test files]
?   	github.com/megaease/easegress/pkg/version	[no test files]
√ easegress $ 

@benja-wu benja-wu added the bug Something isn't working label Jul 7, 2021
@benja-wu benja-wu added this to the v.1.1.0 milestone Jul 7, 2021
@benja-wu benja-wu requested review from localvar and xxx7xxxx July 7, 2021 10:46
@benja-wu
Copy link
Contributor Author

benja-wu commented Jul 8, 2021

Also, this PR aims to solve the cluster test case failure

2021-07-08T02:51:50.758Z	ERROR	cluster/cluster.go:679	register cluster name test-cluster failed: create client failed: couldn't open sink "/tmp/eg-test/test-member-001/log/etcd_client.log": open /tmp/eg-test/test-member-001/log/etcd_client.log: no such file or directory
panic: register cluster name test-cluster failed: create client failed: couldn't open sink "/tmp/eg-test/test-member-001/log/etcd_client.log": open /tmp/eg-test/test-member-001/log/etcd_client.log: no such file or directory
  1. Changing /tmp directory to os.TempDir(). (Recommend by @zhao-kun)
  2. Adding retry logic into the cluster.client in the test case.

@xxx7xxxx xxx7xxxx changed the title [sem] change to use golang.org/x/sync.sem, close #72 Fix unit test failure of semaphore and cluster Jul 8, 2021
@benja-wu benja-wu linked an issue Jul 8, 2021 that may be closed by this pull request
@localvar localvar merged commit d6d7969 into easegress-io:main Jul 8, 2021
@benja-wu benja-wu deleted the sem branch July 8, 2021 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Github Action failed due to the unit test of TestCluster
3 participants