Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Reset state for uTs so tests run independently #159

Merged
merged 1 commit into from
Jul 14, 2020

Conversation

jmazanec15
Copy link
Member

Issue #, if available:
#158

Description of changes:
Test cases were failing because the state from the KNNIndexCache (singleton) was spilling over from other test cases. This PR prevents this by adding a tearDown method which resets counter, clears out the cache, and closes the cache.

In order to test, I replicated the failure on an Ubuntu 16 machine. Then, with the change, it passes. Additionally, I tested the change on a Mac. I was not able to reproduce the failure, but, with the fix, ./gradlew build still passes.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@jmazanec15 jmazanec15 requested a review from vamshin July 6, 2020 16:36
@jmazanec15 jmazanec15 changed the title Added resetState for uTs so state does not spill over FIX: Added resetState for uTs so state does not spill over Jul 9, 2020
Copy link
Member

@vamshin vamshin left a comment

Choose a reason for hiding this comment

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

LGTM!

@jmazanec15 jmazanec15 merged commit e091efa into opendistro-for-elasticsearch:master Jul 14, 2020
chenqi0805 added a commit to chenqi0805/k-NN that referenced this pull request Jul 15, 2020
…asure

* master:
  FIX: Pass -march=x86-64 to build JNI library (opendistro-for-elasticsearch#164)
  FIX: Added resetState for uTs so state does not spill over (opendistro-for-elasticsearch#159)
@jmazanec15 jmazanec15 changed the title FIX: Added resetState for uTs so state does not spill over Added resetState for uTs so state does not spill over Jul 16, 2020
@jmazanec15 jmazanec15 added the Bug Fixes Change that fixes a bug label Jul 16, 2020
@jmazanec15 jmazanec15 changed the title Added resetState for uTs so state does not spill over Reset state for uTs so tests run independently Aug 25, 2020
@jmazanec15 jmazanec15 added Infrastructure Change releated to distribution of plugin and removed Bug Fixes Change that fixes a bug labels Aug 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Infrastructure Change releated to distribution of plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants